Closed metaleap closed 3 years ago
The problem is optimistic human nature, it runs so fast it is easy to miss the error... maybe not on the first run but you will miss an ignored error if you are using imgp over a couple of months without any issues.
Now, let us consider all errors in general - during open, read, write... anytime during the process.
For lazy people like me, the natural next step is to remove the original files without examining all 25 output files one by one. Say, I miss the one cute picture I had of my kid from when he was 2!!! I hope you get the picture. When you set the flag you have no way to determine the amount of damage it can do to you.
So the single reason I wouldn't introduce such a flag is the damage that can be done is irreversible.
But I would request you to add an exception handler and fail more gracefully as you can reproduce the issue.
imgp
is real handy for my mass-resizing needs, thanks a bunch! This is just a little idea for future users, I have a workaround, so feel free to close it =)With 1000s of comic books (100000s of pages) to down-size, it happens that one encounters occasional corrupt jpgs. My bash script after extractions and other preps ultimately call
imgp -m -x 75 -q 66 -w ./*.jpg
. The latter part likely gets expanded by bash into all the jpgs matched in current dir.Anyway, one way or another
imgp
is called once and works through multiple files. Now just 0.01% of those may cause your PIL open or resize or other calls to fail, in my case as follows:Not to worry about that particular error, just would be neat to have a flag such that when
imgp
processes multiple files and just one of them is problematic, it continues processing the other ones and exits with success code 0. It might still warn on stderr or something.I'll work around it for now by looping over the jpg files in the dir and doing one imgp call for each file individually.