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

HandleExtraFileType: reporting after catching Bio-Formats exceptions #20

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions src/main/java/HandleExtraFileTypes.java
Original file line number Diff line number Diff line change
Expand Up @@ -521,20 +521,24 @@ private ImagePlus openImage(final String directory, final String name,
(IJ.getVersion().compareTo("1.38j") < 0 || !IJ.redirectingErrorMessages()) &&
(new File(path).exists()))
{
final Object loci = IJ.runPlugIn("loci.plugins.LociImporter", path);
if (loci != null) {
// plugin exists and was launched
try {
// check whether plugin was successful
final Class<?> c = loci.getClass();
final boolean success = c.getField("success").getBoolean(loci);
final boolean canceled = c.getField("canceled").getBoolean(loci);
if (success || canceled) {
width = IMAGE_OPENED;
return null;
try {
final Object loci = IJ.runPlugIn("loci.plugins.LociImporter", path);
if (loci != null) {
// plugin exists and was launched
// check whether plugin was successful
final Class<?> c = loci.getClass();
final boolean success = c.getField("success").getBoolean(loci);
final boolean canceled = c.getField("canceled").getBoolean(loci);
if (success || canceled) {
width = IMAGE_OPENED;
return null;
}
}
}
catch (final Exception exc) {}
catch (final Exception exc) {
IJ.log("Error opening the input in LociImporter who says:\n-----\n"
+ exc.getMessage() + "\n-----");
if (IJ.debugMode) IJ.handleException(exc);
}
}

Expand Down