-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Errors while processing TIFF images #7845
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
Comments
I gather you're not able to upload one of the images that causes the problem? Or even one of the saved images? I don't suppose you're able to test if the problem is resolved with the latest version of Pillow? Even if we figure this out, we can't properly fix it, because any fixes we make would be for future versions of Pillow, and you're using an outdated version of Pillow - but I think you know this. |
Yes, I went through the contents of _save(im, fp, filename) in Pillow 8.4.0's TiffImagePlugin.py, but I didn't find anything significant. Also, in my code, the original image is deleted after resizing, so I can't reproduce it. Therefore, I can only speculate that it might be an issue with EMC during program execution or disk bad blocks causing changes in the content of IFH. |
I'm not seeing anything so far. If there's no compression, then the offset should be 8. Pillow/src/PIL/TiffImagePlugin.py Line 902 in 40e7ff6
If there's compression, then libtiff would be used. What version of libtiff are you using? >>> from PIL import features
>>> features.version_codec("libtiff")
'4.6.0' |
If the problem is in libtiff, then you could avoid it by saving without compression - |
Closing this issue as no feedback has been received. |
What did you do?
The code below occasionally encounters an issue where, after resizing the TIF image data and saving it to a new location, the four bytes in the file header of the new TIF file that describe the OFFSET position of the IFD (Image File Directory) are set to zero. This prevents the new resized TIF image from being opened.
What did you expect to happen?
The four bytes describing the OFFSET position of the IFD (Image File Directory) should not be zero.
What actually happened?
The four bytes in the file header of the new TIF file that describe the OFFSET position of the IFD (Image File Directory) are set to zero.
~! Most of the time, there are no this issues. I would like to know the possible reasons that could cause this problem in order to reduce such similar errors.
What are your OS, Python and Pillow versions?
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
The text was updated successfully, but these errors were encountered: