ome / bioformats

Bio-Formats is a Java library for reading and writing data in life sciences image file formats. It is developed by the Open Microscopy Environment. Bio-Formats is released under the GNU General Public License (GPL); commercial licenses are available from Glencoe Software.
https://www.openmicroscopy.org/bio-formats
GNU General Public License v2.0
370 stars 241 forks source link

SVS: update isThisType to reject files with a single IFD #4202

Open melissalinkert opened 4 days ago

melissalinkert commented 4 days ago

See https://github.com/IDR/idr-metadata/issues/699.

With this change, I would expect the files from idr0008 to be detected as "plain" TIFF; showinf or similar should initialize and show the image without error. I tested with an artificial file created by:

$ bfconvert "test&sizeX=1000&sizeY=1000.fake" svs-test.tif
$ cat comment.txt 
Aperio Image Library v8.2.43
81713x37331 [70791,733 2942x2942] (0x0) RAW;Scan
{composite image: 41 files}|AppMag = 20
|StripeWidth = 2032
|ScanScope ID = SS1644
|Filename = 156866
|Title = 
|Date = 10/10/13
|Time = 09:14:17
|User = 85966804-1588-42c3-bd9e-88ca3cfca814
|Acquisition Bit Depth = 8
|MPP = 0.4970
|OriginalWidth = 81713|Originalheight = 37331
$ tiffcomment -set comment.txt svs-test.tif

which was enough to demonstrate the original exception, but we may want one of the idr0008 files in the test repo to be safe.

As discussed separately with @sbesson, this is probably the least disruptive way to solve the problem, as it does not require modifying any of the extra image detection logic in SVSReader. I would not expect this to introduce any test failures, and it should be safe for a patch release.