Repository navigation
Releases: Clearmist/comic-archive-handler
Release list
v2.3.1
v2.3.0
v2.2.3
- Zip files store already compressed images.
convertArchivecan strip and rename in the same pass and report what it wrote.- Several metadata schemas are written in one rewrite.
- Zip writes no longer deflate jpg, png, gif, webp and avif entries.
convertArchivegains the strip, renameImages and onEntry options.- The new
addMetadataSetToArchivewrites ComicInfo and MetronInfo together. convertImageBufferdecodes a JPEG page once instead of twice.
v2.2.2
The RAR adapter read the entire file into a buffer, copied it, and had node-unrar-js extract every entry before yielding the first one so even listing entry names cost several times the archive's size in memory.
It now reads the archive from disk through node-unrar-js's file extractor. Listing only walks the entry headers and an entry is decompressed through a staging file when its stream is opened, one entry at a time. A Buffer input is written to the staging directory first.
RAR reads now use the tempDir option. Reading a single entry from a solid archive, or reading entries out of archive order, costs an extra decompression pass.
v2.2.1
v2.2.0
v2.1.0
v2.0.0
2.0.0
This release replaces sharp with @napi-rs/image for all image work and adds AVIF as an output format. Some image options had no equivalent in the new library, so this is a major release. See Breaking changes and Migrating from 1.x below.
New
- AVIF output.
convertImageBuffer,convertArchiveImages, andconvertArchiveaccept'avif'as a format. The newoptions.avifgroup supports:quality(0 to 100, default90;100is lossless)alphaQuality(defaults toquality)speed(1 to 10, default4)chromaSubsampling('4:4:4'by default to keep colored line art sharp;'4:2:0'gives smaller files)threads(encoder threads per image, default0for every core; pass1when converting several images at once withconcurrency)
- AVIF pages are recognized as images.
avifis now inIMAGE_EXTENSIONS, so AVIF pages work with image info, perceptual hashing, renaming, and later conversions. - The benchmark includes AVIF.
BENCHMARK_IMAGE_FORMATSis nowwebp,avif,png,jpg, so a defaultbenchmarkArchiverun produces 16 archives instead of 12. Useoptions.imageFormats(or--image-formats=inbenchmark.js) to pick a subset.
Breaking changes
sharpis no longer a dependency. Image decoding and encoding now use@napi-rs/image.setImageConcurrencyhas been removed. It set libvips threads per image, and the new library has no equivalent setting. Images still run on libuv's threadpool (4 threads by default), so raiseUV_THREADPOOL_SIZEto convert more than 4 images at once.WebpOptions.effortandWebpOptions.smartSubsamplehave been removed. WebP encoding now takes onlyquality(default92).- Perceptual hashes have changed.
computeImagePHashandcomputeArchiveImagePHashnow resize and convert to grayscale with a different library, so their values will not exactly match hashes from 1.x. Recompute any stored hashes before comparing them against new ones. - PNG
compressionLevelmaps to three levels. It still accepts0to9, but0to3is fast,4to6, and7to9is best. The default is 8. - PNG palette quality works differently. With
palette: true,qualityis now the maximum quality for palette quantization (default100). File sizes for the same setting will differ from 1.x.
Fixes
- pHash handles images with transparency. Pages with an alpha channel, 16-bit pages, and floating-point pages are now read correctly.
Migrating from 1.x
- Remove calls to
setImageConcurrency. To run more than 4 images at once, setUV_THREADPOOL_SIZEbefore the process first uses the threadpool. - Remove
effortandsmartSubsamplefrom anywebpoptions. TypeScript will flag them. - If you store perceptual hashes, recompute them with 2.0.0.