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