imageio v3 cannot read metadata of tiff files it created itself
See original GitHub issueimport imageio.v3 as iio, numpy as np; iio.imwrite("test.tiff", np.empty((10, 10, 3), "u1")); print(iio.immeta("test.tiff"))
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python3.10/site-packages/imageio/v3.py", line 264, in immeta
metadata = img_file.metadata(**call_kwargs)
File "/usr/lib/python3.10/site-packages/imageio/core/legacy_plugin_wrapper.py", line 308, in metadata
raise ValueError(
ValueError: Legacy plugins don't support excluding applied metadata fields.
This is as of imageio 2.19.5.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
imageio Documentation - Read the Docs
When creating a GIF using imageio the resulting images can get quite heavy, as the created GIF is not optimized. This can be...
Read more >Revisit how imageio provides and handles meta data #362
Another thing to fix is #371: the meta data can become invalid when it's "used" during reading, e.g. when exif rotation is applied....
Read more >Issue with reading Tiff image metadata with imageIO
I used the stream metadata (which worked) to merge the images. ... image = ImageIO.read(imageFile); bufferedImages.add(new IIOImage(image, ...
Read more >Release 2.16.0 imageio contributors
Note: All read-functions return images as numpy arrays, and have a meta attribute; the meta-data dictionary can be accessed with im.meta. To ...
Read more >TIFF - Wikipedia
Tag Image File Format, abbreviated TIFF or TIF, is an image file format for storing raster graphics images, popular among graphic artists, the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@anntzer I’ve created a PR that will ignore
exclude_applied
for legacy plugins.I don’t think it is a perfect solution, because now it can be surprising for the end-user to see that they get metadata they may not have expected to see, but I can see how it is the lesser of two evils. I will have a think if we can add something to the docs or if we should create a logging message for this.
Assuming that no legacy plugin ever has the ability to exclude applied metadata, I would just silently ignore
exclude_applied=True
for such plugins. Asking people to explicitlyexclude_applied=True
is pretty bad for usability (if you’re trying to write generic library code you’d basically end up having to always putexclude_applied=True
as you can’t know what format you’ll get from your callers) and putting a warning is even worse (you basically have to make the catch_warnings dance).