-
-
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
TypeError on ImageOps.exif_transpose(image) #4238
Comments
Hi! Any ETA on when this makes a release? I'm encountering the very same issue and it's blocking me from releasing to production. Thanks! |
Pillow releases quarterly, the next one is due 2020-01-01: #4210. |
#3980 has been merged, so this is now resolved. The fix will be available as part of Pillow 7.0 |
The bug: python-pillow#4238 See the bug for 2 PRs that fix the problem.
I'm still having the same error on Pillow 7.0.0. The |
@rodrigoruiz do you have an image to demonstrate the warnings, that could be added to the test suite under the Pillow license? |
@rodrigoruiz the warning on tag 282 should now be fixed in Pillow master, and will be part of the next Pillow release, due out on July 1. |
Did this fix make it into Pillow 7.2.0? It was released June 30, not July 1, so not sure... I've attached a good test photo that triggers the error for me in pillow-simd 7.0.0 White dog looking at camera.jpg.zip For people who land here and are using pillow-simd, the code in this PR is a solid workaround for this issue if you want to continue to use pillow-simd: facebookresearch/detectron2#1666 |
Yep, #4637 was merged on June 10 so made it into 7.2.0. |
On odoo.sh, in some circumstances, when uploading an image as attachment in odoo leads to a blank image thumbnail. The same image was successfully uploaded in the same odoo version on runbot instance. After some investigations, it appears that the issue comes from the python-pillow version used. A few bugs exists [0,1,2] in python-pillow 7.0.0 (packaged in ubuntu Focal) that are now fixed in version 8.1.0 [3,4,5] (packaged in Debian and specified in Odoo requirements.txt), that causes the `ImageOps.exif_transpose` method to fail. The present issue can be considered as a corner case as only images with particular exif tags cause the issue. The present fix is a simple workaround by first checking the presence of the orientation tag and using it, we can avoid a call to the `exif_transpose` method. opw-2369166 [0] python-pillow/Pillow#4346 [1] python-pillow/Pillow#3973 [2] python-pillow/Pillow#4238 [3] python-pillow/Pillow#4637 [4] python-pillow/Pillow#3980 [5] python-pillow/Pillow#4009
On odoo.sh, in some circumstances, when uploading an image as attachment in odoo leads to a blank image thumbnail. The same image was successfully uploaded in the same odoo version on runbot instance. After some investigations, it appears that the issue comes from the python-pillow version used. A few bugs exists [0,1,2] in python-pillow 7.0.0 (packaged in ubuntu Focal) that are now fixed in version 8.1.0 [3,4,5] (packaged in Debian and specified in Odoo requirements.txt), that causes the `ImageOps.exif_transpose` method to fail. The present issue can be considered as a corner case as only images with particular exif tags cause the issue. The present fix is a simple workaround by first checking the presence of the orientation tag and using it, we can avoid a call to the `exif_transpose` method. opw-2369166 [0] python-pillow/Pillow#4346 [1] python-pillow/Pillow#3973 [2] python-pillow/Pillow#4238 [3] python-pillow/Pillow#4637 [4] python-pillow/Pillow#3980 [5] python-pillow/Pillow#4009 closes #65584 Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
On odoo.sh, in some circumstances, when uploading an image as attachment in odoo leads to a blank image thumbnail. The same image was successfully uploaded in the same odoo version on runbot instance. After some investigations, it appears that the issue comes from the python-pillow version used. A few bugs exists [0,1,2] in python-pillow 7.0.0 (packaged in ubuntu Focal) that are now fixed in version 8.1.0 [3,4,5] (packaged in Debian and specified in Odoo requirements.txt), that causes the `ImageOps.exif_transpose` method to fail. The present issue can be considered as a corner case as only images with particular exif tags cause the issue. The present fix is a simple workaround by first checking the presence of the orientation tag and using it, we can avoid a call to the `exif_transpose` method. opw-2369166 [0] python-pillow/Pillow#4346 [1] python-pillow/Pillow#3973 [2] python-pillow/Pillow#4238 [3] python-pillow/Pillow#4637 [4] python-pillow/Pillow#3980 [5] python-pillow/Pillow#4009 X-original-commit: b83c48d
On odoo.sh, in some circumstances, when uploading an image as attachment in odoo leads to a blank image thumbnail. The same image was successfully uploaded in the same odoo version on runbot instance. After some investigations, it appears that the issue comes from the python-pillow version used. A few bugs exists [0,1,2] in python-pillow 7.0.0 (packaged in ubuntu Focal) that are now fixed in version 8.1.0 [3,4,5] (packaged in Debian and specified in Odoo requirements.txt), that causes the `ImageOps.exif_transpose` method to fail. The present issue can be considered as a corner case as only images with particular exif tags cause the issue. The present fix is a simple workaround by first checking the presence of the orientation tag and using it, we can avoid a call to the `exif_transpose` method. opw-2369166 [0] python-pillow/Pillow#4346 [1] python-pillow/Pillow#3973 [2] python-pillow/Pillow#4238 [3] python-pillow/Pillow#4637 [4] python-pillow/Pillow#3980 [5] python-pillow/Pillow#4009 X-original-commit: b83c48d
On odoo.sh, in some circumstances, when uploading an image as attachment in odoo leads to a blank image thumbnail. The same image was successfully uploaded in the same odoo version on runbot instance. After some investigations, it appears that the issue comes from the python-pillow version used. A few bugs exists [0,1,2] in python-pillow 7.0.0 (packaged in ubuntu Focal) that are now fixed in version 8.1.0 [3,4,5] (packaged in Debian and specified in Odoo requirements.txt), that causes the `ImageOps.exif_transpose` method to fail. The present issue can be considered as a corner case as only images with particular exif tags cause the issue. The present fix is a simple workaround by first checking the presence of the orientation tag and using it, we can avoid a call to the `exif_transpose` method. opw-2369166 [0] python-pillow/Pillow#4346 [1] python-pillow/Pillow#3973 [2] python-pillow/Pillow#4238 [3] python-pillow/Pillow#4637 [4] python-pillow/Pillow#3980 [5] python-pillow/Pillow#4009 X-original-commit: b83c48d
On odoo.sh, in some circumstances, when uploading an image as attachment in odoo leads to a blank image thumbnail. The same image was successfully uploaded in the same odoo version on runbot instance. After some investigations, it appears that the issue comes from the python-pillow version used. A few bugs exists [0,1,2] in python-pillow 7.0.0 (packaged in ubuntu Focal) that are now fixed in version 8.1.0 [3,4,5] (packaged in Debian and specified in Odoo requirements.txt), that causes the `ImageOps.exif_transpose` method to fail. The present issue can be considered as a corner case as only images with particular exif tags cause the issue. The present fix is a simple workaround by first checking the presence of the orientation tag and using it, we can avoid a call to the `exif_transpose` method. opw-2369166 [0] python-pillow/Pillow#4346 [1] python-pillow/Pillow#3973 [2] python-pillow/Pillow#4238 [3] python-pillow/Pillow#4637 [4] python-pillow/Pillow#3980 [5] python-pillow/Pillow#4009 X-original-commit: b83c48d
What did you do?
I was trying to process a dataset on the Detectron2 framework.
What did you expect to happen?
I expected the code to run with no exception.
What actually happened?
TypeError: object of type 'int' has no len()
Here the complete stacktrace:
What are your OS, Python and Pillow versions?
Here the link to the file:
https://www.dropbox.com/s/z5tc5zddqw20n15/pt59.zip?dl=0
This problem happened to 3 files from the whole dataset, since the images were proprocessed by the same script and taken from the same camera, I don't understand what might be wrong, or if it is a problem on the image or on the PIL library itself.
The text was updated successfully, but these errors were encountered: