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, orthumb). - 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.cbzfiles and generates thumbnails intothumbnails_dir.src/image.phpβ serves images from a CBZ and supportsthumb=1&w=...&h=...to request resized thumbnails.src/gallery.phpβ renders a gallery of indexed CBZ archives (uses thumbnails generated by the indexer or0000if present).src/viewer.php(historically) andsrc/viewer_clean.php(clean replacement) β in-browser reader. Ifsrc/viewer.phpis broken, usesrc/viewer_clean.phpas?file=archive.cbz.config/config.phpβ main configuration (CBZ directory, thumbnails directory, allowed image extensions, CSS path).
Quick start
-
Configure paths in
config/config.php. -
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 initiallymode=continuousβ continuous scroll mode
Configuration
config/config.phpcontains keys used by the scripts:cbz_dirβ directory containing.cbzfilesthumbnails_dirβ directory where thumbnails are writtenimage_extensionsβ allowed extensionscssβ 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_dirand that thecbzandnamequery params are correct.
(thats also my first project where i try to document code correctly :3)