Skip to content

Commit

Permalink
fix: more robust detection of n5 supported extension
Browse files Browse the repository at this point in the history
* ignore trailing slashes in file path
  • Loading branch information
bogovicj committed May 21, 2024
1 parent d38bc18 commit 15f3b9d
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/main/java/bdv/ij/BigWarpImagePlusPlugIn.java
Original file line number Diff line number Diff line change
Expand Up @@ -195,17 +195,17 @@ public void run( final String arg )

}

private static boolean openWithImageJ( final String rootPath )
{
if( rootPath.endsWith( ".n5" ) ||
rootPath.endsWith( ".zarr" ) ||
rootPath.endsWith( ".h5" ) ||
rootPath.endsWith( ".xml" ) ||
rootPath.endsWith( ".hdf5" ))
{
private static boolean openWithImageJ(final String rootPath) {

// remove trailing slash
final String rootPathNorm = rootPath.replaceFirst("/*$", "");
if (rootPathNorm.endsWith(".n5") ||
rootPathNorm.endsWith(".zarr") ||
rootPathNorm.endsWith(".h5") ||
rootPathNorm.endsWith(".xml") ||
rootPathNorm.endsWith(".hdf5")) {
return false;
}
else
} else
return true;
}

Expand Down

0 comments on commit 15f3b9d

Please sign in to comment.