question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

imageio v3 cannot read metadata of tiff files it created itself

See original GitHub issue
import 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:closed
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
FirefoxMetzgercommented, Jul 22, 2022

@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.

0reactions
anntzercommented, Jul 21, 2022

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 explicitly exclude_applied=True is pretty bad for usability (if you’re trying to write generic library code you’d basically end up having to always put exclude_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).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found