Closed ajslater closed 4 months ago
Hello,
I am not able to reproduce the issue. I encoded a JPEG with the following code:
#!/usr/bin/env python3
import mozjpeg_lossless_optimization
with open("./photo.jpg", "rb") as input_jpeg_file:
input_jpeg_bytes = input_jpeg_file.read()
output_jpeg_bytes = mozjpeg_lossless_optimization.optimize(input_jpeg_bytes)
with open("./out.jpg", "wb") as output_jpeg_file:
output_jpeg_file.write(output_jpeg_bytes)
Results for me are:
-rw-rw-r-- 1 fabien fabien 1,8M juin 8 2013 photo.jpg
-rw-rw-r-- 1 fabien fabien 1,6M janv. 31 14:45 out.jpg
$ exiftool photo.jpg | grep Encoding
Encoding Process : Baseline DCT, Huffman coding
$ exiftool out.jpg | grep Encoding
Encoding Process : Progressive DCT, Huffman coding
I also tried to truncate the files to be sure, and we can see that there is a missing part on the input image (scanline) and that on the other one it is pixelated (progressive):
I tried with both my development version and a package on PyPI (mozjpeg_lossless_optimization-1.1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
)
Can you tel me more to help me reproducing this?
:)
My apologies for not noticing your response earlier this year. Got lost in my email.
I've just tried to to replicate the results of this issue with a couple different jpegs including the 97373 byte input file from the original issue and I cannot. I'm unsure if the 1.1.3 version of mozjpeg-lossless-optimization changed or (more likely) there was a flaw with my experiments that lead me to file this issue report.
Thanks for making these bindings and taking the time to try to reproduce.
In my testing of this code, output is larger than running the mozjpeg jpegtran command line tool with -optimize and -progressive. Additionally exiftool reports that it was encoded with the Baseline transform, not the Progressive transform.
Input
mozjpgeg-lossless-optimization
mozjpeg cli