-
-
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
Why is it not possible to set jfif data when saving a jpeg file? #3328
Comments
Hi. Just to note in this issue, given that you’re using ONYX RIPCenter, I conclude that you’re using Windows. My partial answer is that I think Pillow does actually write JFIF data - https://github.com/python-pillow/Pillow/blob/master/src/libImaging/JpegEncode.c#L221
All that said, I’m surprised that ‘JFIF version’ is not present on out.jpg. What’s the exact exiftool command that you’re running? Are you able to upload in.jpg? |
Hi, I'm actually using OSX for development and the production application is running on Ubuntu. ONYX RIPCenter is used by the printing company. Is it possible that pillow writes JFIF data only when the JPEG image is progressive? - https://github.com/python-pillow/Pillow/blob/master/src/libImaging/JpegEncode.c#L217 Here is the exiftool(v11.10) command I use, I do have to mention one thing though, when I use exiftool to set JFIF, it fails when the adobe application marker is present. This is the warning I get "Warning = Not creating JFIF in JPEG with Adobe APP14". The workaround I found is,
|
Some notes
When you say that the DPI changes on saving, I don't think this is quite so simple. When I inspect the original and the saved images in macOS Preview, they both have a DPI of 180. Your exiftool output shows for the original image
and for the output image
So, back to the basic question, why is the JFIF X Resolution missing on save? I've created PR #4639 to fix this. |
What did you do?
I'm trying to modify and save an image with jfif data, because an application I am using (Onyx RipCenter) requires this information to set the DPI. Currently it shows incorrect width and height because it has the wrong DPI. Instead of 180, it shows 72.
What did you expect to happen?
That the new image contains jfif application marker
What actually happened?
contains no jfif data. According to the doc here - https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html#jpeg you could get jfif when opening an image file but cannot save the same info. Why is that?
What versions of Pillow and Python are you using?
Python 3.6 and Pillow 5.2.0
Source Image
Target Image
The text was updated successfully, but these errors were encountered: