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
PlanarConfiguration save #3622
Comments
The PlanarConfiguration tag value is wrong. It should be CONTIG (but is SEPARATE). You can verify by patching the example file with a hex editor at position 126 from 2 to 1. |
You've provided a copy of the output image. Are you able to provide a copy of one of the images that you are running this script over? |
It seems any input image with PlanarConfiguration=2 will trigger this bug. |
Ok, thanks. On macOS 10.14, if I try to save https://github.com/python-pillow/Pillow/blob/master/Tests/images/tiff_tiled_planar_raw.tif I get a black image. im = Image.open('tiff_tiled_planar_raw.tif')
im.save('out.tif') Presuming that this is the same issue, if you're interested in an immediate solution, I would recommend adding in from PIL import Image
import os
mode = input("Enter mode")
files = [f for f in os.listdir('./{}'.format(mode)) if os.path.isfile(os.path.join('./{}'.format(mode), f))]
im = Image.open('./{}/{}'.format(mode, files[0]))
im.show()
input()
im.thumbnail((512, 512), Image.ANTIALIAS)
im._planar_configuration = 1
im.save('./PILissue.tiff') |
I've created #5973 to fix this. |
What did you do?
im = Image.open(..blah)
im.thumbnail(..blah)
im.save('file_two.tif/tiff')
- Same issue for tiff and tif.What did you expect to happen?
Image would be saved, scaled down, and viewable.
What actually happened?
Image was downscaled, but corrupt, appears red and pixellated, cannot be opened in some image viewers.
Note: I cannot repeat this on Mac OS, haven't tried this on Debian... yet.
What are your OS, Python and Pillow versions?
The text was updated successfully, but these errors were encountered: