diff --git a/src/loci/formats/in/ZarrReader.java b/src/loci/formats/in/ZarrReader.java index c77d582..5a3b696 100644 --- a/src/loci/formats/in/ZarrReader.java +++ b/src/loci/formats/in/ZarrReader.java @@ -1089,10 +1089,17 @@ public String[] getUsedFiles(boolean noPixels) { FormatTools.assertId(currentId, true, 1); String zarrRootPath = currentId.substring(0, currentId.indexOf(".zarr") + 5); ArrayList usedFiles = new ArrayList(); - try (Stream paths = Files.walk(Paths.get(zarrRootPath), FileVisitOption.FOLLOW_LINKS)) { - paths.filter(Files::isRegularFile) - .forEach(path -> usedFiles.add(path.toFile().getAbsolutePath())); + boolean skipPixels = noPixels || !listPixels(); + LOGGER.error("ZarrReader getUsed files, skipPixels: {}", skipPixels); + LOGGER.error("ZarrReader fetching list of used files: {}", zarrRootPath); + try (Stream paths = Files.walk(Paths.get(zarrRootPath), FileVisitOption.FOLLOW_LINKS)) { + paths.filter(Files::isRegularFile) + .forEach(path -> {if (!skipPixels || + (skipPixels && (path.endsWith(".zgroup") || path.endsWith(".zattrs") || path.endsWith(".xml")))) + usedFiles.add(path.toFile().getAbsolutePath()); + LOGGER.error("Adding to the used files list: {}", path.toFile().getAbsolutePath()); + }); } catch (IOException e) { e.printStackTrace(); }