-
Notifications
You must be signed in to change notification settings - Fork 43
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
getThumbnail does not handle all encodings in TileOutputMimeTypes #950
Comments
|
Curious. Some formats require certain image modes (e.g., based on the error above, palm MUST be black and white, not greyscale or color). I wonder if there is a way to either coerce the image mode to satisfy the format or determine when they are incompatible and not list them. |
This would be preferred IMO |
At the very least, I would expect opening the image with the same encoding to work. E.g.: src = large_image.open('/Users/bane/Desktop/rasters/converted.tif', encoding='PALM')
thumb_data, mime_type = src.getThumbnail(encoding='PALM')
|
So we can test which modes/formats works and be more intelligent on how we handle them, but at a cost of ~90ms startup time on my test machine:
|
Could we implement a |
See #951 for a fix. This has a blacklist for a few formats -- the icon formats output fixed sizes, so they don't work as general output formats. And, some formats aren't readable with PIL (at least not from a byte string), so they are harder to test. This will gracefully fallback to lower color modes as needed for formats where that is needed. |
The following test and note it fails for some encodings listed as supported
Note that this is causing failures for
django-large-image
: https://github.com/girder/django-large-image/runs/8082224710?check_suite_focus=trueThe text was updated successfully, but these errors were encountered: