Skip to content
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

Support OME-TIFFs with non-compliant file extensions #11

Open
hadim opened this issue Mar 3, 2014 · 3 comments
Open

Support OME-TIFFs with non-compliant file extensions #11

hadim opened this issue Mar 3, 2014 · 3 comments
Milestone

Comments

@hadim
Copy link

hadim commented Mar 3, 2014

Don't you think Tiff files should be checked even if they only have .tiff or .tif extension ?

In OMETIFFFormat.java:

    @Override
    protected String[] makeSuffixArray() {
        return new String[] { "ome.tif", "ome.tiff" };
    }

could become

    @Override
    protected String[] makeSuffixArray() {
        return new String[] { "ome.tif", "ome.tiff", "tif", "tiff" };
    }

Now I don't know at which point it's computer heavy to test for OME Tiff format.

According to isFormat in Checker (line 463), false is returned pretty quickly if xml string is not detected (see line 490). So between line 466 and line 485, it's all about reading the first IFD, which should has been done anyway.

@hinerm
Copy link
Member

hinerm commented Mar 3, 2014

By the OME-TIFF specification the OME-TIFF format must end in ome.tif or ome.tiff, so we can not add more suffix checking to this Format.

If it's some variant of .tif or .tiff it will likely come down to reading IFDs, as you mentioned, which has to be left up to the individual TIFF format (though a TIFFService would allow us to parse the IFD once and then pass it around, instead of reparsing for each TIFF flavor).

@hinerm hinerm closed this as completed Mar 3, 2014
@hadim
Copy link
Author

hadim commented Mar 3, 2014

Ok. Thanks !

@ctrueden
Copy link
Member

ctrueden commented Mar 3, 2014

@hinerm: While it is true that the OME-TIFF specification mandates the use of .ome.tif or .ome.tiff extension, that was not always the case. So there are unfortunately older OME-TIFF files in the wild with extension .tif and .tiff and Bio-Formats makes an effort to support them. SCIFIO will need to do the same.

However, simply adding .tif to the list of suffixes of OMETIFFFormat is probably not the right answer. The Bio-Formats library currently sets suffixNecessary and suffixSufficient to false to handle this case.

Anyway, I'm going to reopen this issue to make sure that TIFF files without .ome.tif extension are still handled properly as OME-TIFFs, at least to the extent feasible.

@ctrueden ctrueden reopened this Mar 3, 2014
@ctrueden ctrueden modified the milestones: scifio-1.0.0, scifio-ome-xml-1.0.0 Mar 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants