croptool icon indicating copy to clipboard operation
croptool copied to clipboard

Cannot crop incomplete file (lossless JPEG mode)

Open royjor2016 opened this issue 5 years ago • 6 comments

example: https://commons.wikimedia.org/wiki/File:Zentrale_Lotto_Rheinland-Pfalz.jpg

[Error] Command "/data/project/croptool/jpeg-9a/jpegtran -copy all -crop '3992x2475+0+0' '/mnt/nfs/labstore-secondary-tools-project/croptool/public_html/files/1b596d50a7942ce8de970db3087dee40c1e2bb33.jpg' > '/mnt/nfs/labstore-secondary-tools-project/croptool/public_html/files/1b596d50a7942ce8de970db3087dee40c1e2bb33_cropped.jpg' 2>&1" exited with code 2: 2

royjor2016 avatar Apr 09 '19 22:04 royjor2016

Hm, I couldn't find an option to make jpegtran ignore errors, so lossless cropping might not be possible.

Did you try precise mode? Think that might work.

danmichaelo avatar Apr 10 '19 15:04 danmichaelo

Same as #131

danmichaelo avatar Apr 10 '19 15:04 danmichaelo

Yes it works in Precise Mode. I've actually cropped incomplete ones before. I must have done it in precise too but I forgot. Still, is it possible to perform a lossless crop?

royjor2016 avatar Apr 10 '19 15:04 royjor2016

Perhaps, but not to my knowledge.

danmichaelo avatar Apr 10 '19 20:04 danmichaelo

Cropping https://commons.wikimedia.org/wiki/File:2019_Virginia_Avenue_train_tunnel_entrance.jpg worked in precise mode, perhaps you could generate a more user-friendly message when the user is trying to losslessly crop an incomplete file?

Jeff-Gdot avatar Apr 11 '19 07:04 Jeff-Gdot

Yeah, I also thought about that, the error message could definitely be improved. Perhaps something like "Precise crop failed for incomplete or invalid JPG file, please try precises mode."

danmichaelo avatar Apr 11 '19 21:04 danmichaelo