ajslater / picopt

A multi format lossless image optimizer that uses external tools
GNU General Public License v3.0
108 stars 11 forks source link

Picopt crashes on broken files in format detection #23

Closed mmsterful closed 2 years ago

mmsterful commented 7 years ago

don't have a log, unfortunately, as my computer overheated and rebooted in an unrelated event, and my terminal windows closed. I'm using picopt 1.4.4 as installed by pip.

I'm running it with the version of Pillow installed by pip, and previously it would crash when PIL/Pillow threw an IndexError: string index out of range. After checking StackOverflow for a possible solution, I set LOAD_TRUNCATED_IMAGES to True in Pillow's ImageFile.py, and now it crashes (not sure if it's on the same files) when PIL throws an exception about a .png file's IDAT checksum being incorrect. Both crashes take place in the format detection stage

Seeing as I have 300 gigs of nearly unsorted images to optimize for a project, it'd be nice if it gracefully handled errors, maybe with an option to log the filenames of broken files.

ajslater commented 6 years ago

broken file logging (finally) implemented in picopt 1.5.0