Skip to content

tyt4real/lecomics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

lecomics β€” small CBZ/CBR viewer (PHP)

Summary of features

  • Read images from ZIP/CBZ archives into PHP (binary contents or served on-demand).
  • Index a folder of CBZ files and create per-archive thumbnails (prefers files named 0000, cover, folder, or thumb).
  • Serve images from inside archives via src/image.php (supports thumbnail resizing).
  • Lightweight gallery (src/gallery.php) and in-browser viewer (src/viewer.php / src/viewer_clean.php) with single/scroll modes.

Where to look

  • src/ZipImageReader.php β€” utility to list and read image files from a ZIP archive.
  • src/CBZIndexer.php + src/index_cbz.php β€” indexer that scans a directory of .cbz files and generates thumbnails into thumbnails_dir.
  • src/image.php β€” serves images from a CBZ and supports thumb=1&w=...&h=... to request resized thumbnails.
  • src/gallery.php β€” renders a gallery of indexed CBZ archives (uses thumbnails generated by the indexer or 0000 if present).
  • src/viewer.php (historically) and src/viewer_clean.php (clean replacement) β€” in-browser reader. If src/viewer.php is broken, use src/viewer_clean.php as ?file=archive.cbz.
  • config/config.php β€” main configuration (CBZ directory, thumbnails directory, allowed image extensions, CSS path).

Quick start

  1. Configure paths in config/config.php.

  2. Profit.

Usage notes

  • To request an image directly (served from inside the archive): /src/image.php?cbz=archive.cbz&name=path/inside/archive.jpg

  • The viewer accepts optional query params:

    • page β€” 1-based page number to open initially
    • mode=continuous β€” continuous scroll mode

Configuration

  • config/config.php contains keys used by the scripts:
    • cbz_dir β€” directory containing .cbz files
    • thumbnails_dir β€” directory where thumbnails are written
    • image_extensions β€” allowed extensions
    • css β€” path to a stylesheet (viewer and gallery will attempt to use it; a fallback inline style exists)

Troubleshooting

  • If an image endpoint returns 500 or 404, check cbz_dir and that the cbz and name query params are correct.

(thats also my first project where i try to document code correctly :3)

About

Omega-simple, lightweight manga viewer.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published