imagej_metadata failed with ValueError
See original GitHub issueWhen opening a TiffFile the method imagej_metadata raises this exception:
imagej_metadata failed with ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
Line: 15365 @ tifffile.py:
if not bytecounts:
Maybe replace with something like:
if not bytecounts.size > 0:
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
ValueError when getting tiff tags · Issue #2006 · python-pillow ...
What did you do? I tried to extract metadata from a .tif file. What did you expect to happen? get the metadata. What...
Read more >Replace/add Tiff image tags using Pillow from one file to another
But there are some tags which are tags like ImageJMetaData , which ... on two gif images returns the error ValueError: image has...
Read more >Tests/test_file_tiff_metadata.py · squarecapadmin/Pillow
assertEqual(loaded.tag[ImageJMetaData], bindata) self. ... try: info = dict(info) except ValueError: self.fail("Should not be struct value error there.
Read more >Reading pixel size from image file with python - Usage & Issues
ValueError: Cannot read Bioformats from non-local file system. ... doesn't use the ImageJ metadata to get metadata for it's own object.
Read more >imageio Documentation - Read the Docs
[{bool, int, float, str}] If truthy, this function will raise an error if the ... index=None it should set a more sensible default...
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 Free
Top 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
Fixed in v2022.2.2.
I just tried this on my end with a problematic file, and I can confirm that this fixes the problem.
Before (tifffile 2022.11.2):
After (tifffile 2022.02.2):