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

Fix disabled file grouping for Micro-Manager and OME-TIFF #1687

Merged
merged 1 commit into from Mar 27, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -126,6 +126,12 @@ public boolean isThisType(String name, boolean open) {
return false;
}
}
else if (!isGroupFiles()) {
// if file grouping was disabled, allow each of the TIFFs to be
// read separately; this will have no effect if the metadata file
// is chosen
return false;
}
try {
Location parent = new Location(name).getAbsoluteFile().getParentFile();
Location metaFile = new Location(parent, METADATA);
Expand Down
12 changes: 11 additions & 1 deletion components/formats-bsd/src/loci/formats/in/OMETiffReader.java
Expand Up @@ -162,7 +162,17 @@ public boolean isThisType(String name, boolean open) {
return true;
}
metaFile = new Location(name).getAbsolutePath();
return super.isThisType(name, open);
boolean valid = super.isThisType(name, open);
if (valid && !isGroupFiles()) {
try {
return isSingleFile(metaFile);
}
catch (Exception e) {
LOGGER.debug("", e);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing debug message?

return false;
}
}
return valid;
}

/* @see loci.formats.IFormatReader#isThisType(RandomAccessInputStream) */
Expand Down