Comic archive checker: files for "How to Translate a CBZ or CBR Comic Archive" https://www.booktranslator.app/blog/translate-cbz-comics FILES check_comic_archive.py Reads a .cbz file (or a folder of extracted pages) and prints the page order, sorting problems, junk entries, non-page images, spreads, tall strips, and the ComicInfo.xml reading direction. With --repack it writes a new CBZ with zero-padded page names. Python 3.8+ standard library only; runs offline. make_test_comic.py Builds test-comic.cbz, the sample archive used in the article: 12 numbered pages without zero padding, an unnumbered cover.png, one 800x600 spread (page 7), an AVIF file named 13.avif, macOS junk entries, and a ComicInfo.xml with Manga=YesAndRightToLeft and a 13-row page table. The archive is byte-identical between runs on the same Python build. With Python 3.14.3 on macOS it is SHA-256 d386bba72097df250680a5e51d2cfa6a7c65b9e1610a34aa6b114fe9db1aeeec (a Python linked against a different zlib, such as zlib-ng, can differ). REPRODUCE python3 make_test_comic.py python3 check_comic_archive.py test-comic.cbz python3 check_comic_archive.py test-comic.cbz --first cover.png --repack fixed.cbz python3 check_comic_archive.py fixed.cbz The first check reports four problems: a plain character sort disagrees with natural order at position 2, cover.png sorts to position 13, page numbers mix 1 and 2 digits, and 13.avif is not a page format. After the repack, the pages are 0001.png..0013.png with the cover first, the junk entries are gone, and only the AVIF warning remains. HOW THE SORT WAS CHECKED natural_key() approximates JavaScript's Intl.Collator("en", {numeric: true, sensitivity: "base"}), the comparison BookTranslator uses to order .cbz pages. On 2026-10-30 its order matched Node.js 25.2.1 on 18 hand-picked ASCII names (chapter folders, mixed case, spaces, hyphens and underscores) and 400 random names drawn from "ab AB_-./0123456789". It does not fold accents or kana: names such as "Écran 1" or katakana/hiragana mixes can sort differently. Zero-padded ASCII names avoid the question for every tool. LIMITS - RAR (CBR), 7z (CB7) and tar (CBT) archives are detected, not opened. Extract them first and run the script on the folder. - --first changes page positions; a ComicInfo.xml table is copied as it is, so check its Image numbers after reordering. - Image sizes come from file headers. Unusual or damaged headers report no size. - The checker cannot see text in images or judge translation quality.