Skip to content

Commit

Permalink
Make setWriteSequentially(...) call configurable in bfconvert
Browse files Browse the repository at this point in the history
-no-sequential won't change the order in which planes/tiles are written,
just the writer's assumption of plane/tile order.
  • Loading branch information
melissalinkert committed Nov 4, 2021
1 parent 25debdd commit 3208d92
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ public final class ImageConverter {
private boolean useMemoizer = false;
private String cacheDir = null;
private boolean originalMetadata = true;
private boolean noSequential = false;

private IFormatReader reader;
private MinMaxCalculator minMax;
Expand Down Expand Up @@ -244,6 +245,9 @@ else if (args[i].equals("-pyramid-resolutions")) {
}
catch (NumberFormatException e) { }
}
else if (args[i].equals("-no-sequential")) {
noSequential = true;
}
else if (!args[i].equals(CommandLineTools.NO_UPGRADE_CHECK)) {
LOGGER.error("Found unknown command flag: {}; exiting.", args[i]);
return false;
Expand Down Expand Up @@ -360,6 +364,7 @@ private void printUsage() {
" -tiley: image will be converted one tile at a time using the given tile height",
" -pyramid-scale: generates a pyramid image with each subsequent resolution level divided by scale",
"-pyramid-resolutions: generates a pyramid image with the given number of resolution levels ",
" -no-sequential: do not assume that planes are written in sequential order",
"",
"The extension of the output file specifies the file format to use",
"for the conversion. The list of available formats and extensions is:",
Expand Down Expand Up @@ -605,7 +610,7 @@ public boolean testConvert(IFormatWriter writer, String[] args)
throw new FormatException(e);
}
}
writer.setWriteSequentially(true);
writer.setWriteSequentially(!noSequential);

if (writer instanceof TiffWriter) {
((TiffWriter) writer).setBigTiff(bigtiff);
Expand Down

0 comments on commit 3208d92

Please sign in to comment.