* initial fix
* initial
* working, but mobi is a bit too large
* changed target size to 190mb to account for mobi conversion size increase
* changed target size back to 195
* removed debugging print statements
* add trailing comma
---------
Co-authored-by: Alex Xu <alexkurosakimh3@gmail.com>
* Eliminate unnecessary use of MD5 checksum
md5checksum() computes the actual checksum of a specified file, which is appropriately expensive, but the code seemed to be using the checksum result as a key into the imgMetadata dictionary to avoid handling image files being renamed during processing steps. This seems like a very expensive way to handle the rename so instead, I now update the imgMetadata keys with the new filename in the one place that the rename happens, and avoid MD5 checksums entirely.
* merge conflicts
* Add missing handling for image path renames due to nested chapter folder name
* merge conflicts
* merge conflicts
* add perf_counters
* imgFileProcessing perf_counter
* use startswith and removeprefix
---------
Co-authored-by: utopiafallen <utopiafallen@gmail.com>
Commit f952634971 moved image corruption detection out from the ComicPage constructor and into a standalone detectCorruption() function. This led to a performance regression because now corruption detection happens in a single thread when it used to be distributed across worker threads, and because a source image is now loaded twice in memory: once during corruption detection and once when actually going to process the image.
Image file corruption detection is now back inside the ComicPage constructor and the extra load() has been removed because the convert() call will automatically invoke load() and most likely throw the same exceptions.