mozjpeg icon indicating copy to clipboard operation
mozjpeg copied to clipboard

jpegtran lossy for corrupted file

Open JayXon opened this issue 8 years ago • 3 comments

After this:

jpegtran -outfile 5c67195f6993c9f8d0d32d4ffe0d8e62_mozjpeg.jpg 5c67195f6993c9f8d0d32d4ffe0d8e62.jpg

some pixels slightly changed.

5c67195f6993c9f8d0d32d4ffe0d8e62.jpg: 5c67195f6993c9f8d0d32d4ffe0d8e62 5c67195f6993c9f8d0d32d4ffe0d8e62_mozjpeg.jpg: 5c67195f6993c9f8d0d32d4ffe0d8e62_mozjpeg

This file is from https://github.com/MozillaSecurity/fuzzdata/blob/master/samples/jpg/5c67195f6993c9f8d0d32d4ffe0d8e62.jpg some other files in that directory also have this issue.

JayXon avatar Sep 28 '16 06:09 JayXon

The input file is corrupted, so it's not entirely surprising.

kornelski avatar Oct 04 '16 17:10 kornelski

Yes, the file is malformed, which is good for testing edge cases. The file can be opened by major browsers and photo viewers without error, so I'd expect mozjpeg could handle this file correctly (lossless).

JayXon avatar Oct 05 '16 05:10 JayXon

This isn't really an edge-case. It's a corrupt file. The solution here is to make mozjpeg warn when the input is corrupt, but I really don't see the point in wasting time trying to make it tiptoe around corrupt files in order to preserve the already corrupt data.

CoolOppo avatar Oct 10 '16 17:10 CoolOppo