-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Since 10.0.1, saving an image as a JPEG does not always result in files of the same size #7477
Comments
How did you install Pillow? Out of curiosity - how did you find this problem? |
@radarhere I installed it with We found it because we have some integration tests in our product that create JPEGs, and we check the file size of the created JPEG. After upgrading, we saw that we were getting different file sizes for different executions. |
In our Pillow 10.0.1 wheels, we upgraded from libjpeg-turbo 2.1.5.1 to 3.0.0. Testing, I find that upgrading libjpeg-turbo 3.0.1 fixes this. So this is resolved by #7472 If you would like to test this, or have an immediate fix, you can install |
@radarhere Do you know when 10.2.0 will be officially released? |
Jan 1? |
Close, Jan 2 :) https://github.com/python-pillow/Pillow/milestone/57
|
From our testing, we can see that Pillow corrupts the last few pixels in the JPEGs, and that's why the file sizes are different. Is there any possibility of an earlier release? |
Does it help at all if I say that it is not Pillow itself that has the problem, just the wheels of Pillow 10.1.0? So if you install Pillow from source, the problem will go away. |
I encountered the same problem in a different way: on macOS the hardware JPEG decoder started complaining when decoding JPEG files created with Pillow 10.1.0. The error looks like this: |
Pillow 10.2.0 has now been published, with libjpeg-turbo 3.0.1 in the wheels. |
Also woo hoo! |
What did you do?
Using Pillow 10.0.1 and above, saving an image as a JPEG does not always result in the same number of bytes being written.
What did you expect to happen?
Saving the same image multiple times as a JPEG would result in files of the same size.
What actually happened?
The file sizes differ
What are your OS, Python and Pillow versions?
Actual Output:
Expected output:
The number of bytes should be the same for each iteration.
The text was updated successfully, but these errors were encountered: