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
Getting TypeError when saving TIFF file #1524
Comments
Thanks for reporting the problem. I don't suppose you'd be able to provide an image to demonstrate the problem? It would make debugging the issue easier. |
It's the metadata that's failing, so it's related to the big IFD rewrite that happened. I'd really need to see the image metadata to trace through why it's happening though. |
I got exactly the same issue using matplotlib imsave. Matplotlib (at least, version 1.5) uses the PIL tiff writer. |
I had some more time to look at this problem. This code reproduces the problem with matplotlib 1.5 and Pillow 3.0.0: import matplotlib.pyplot as plt
fig = plt.figure()
fig.savefig('temp.tif') It seems to have something to do with tag 338, it is defined in |
Had this exact same error last week. I had to roll back to Pillow 2.9.0 and everything works again. |
This seems to appear on any RGBA image. It's trying to write the "ExtraSamples" tag, which only appears for RGBA and RGBX images. |
As far as I can tell, write_byte does not handle being passed an int instead of a string, and the ExtraSamples tag is incorrectly typed as a byte instead of a short. |
Confirmed in the spec: http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf |
With the PR merged, this can be closed, yes? |
I don't think so, extra samples is not directly implicated in the original error, which was never tracked down. |
The full traceback is at the bottom. This seems to occur only when the typ variable has a value of 1, in which case self._write_dispatch[typ] becomes <function ImageFileDirectory_v2._register_basic.. at 0x7f5b650e59d8>.
The text was updated successfully, but these errors were encountered: