From b20ef9c57cc236db83a5935713723f87050fbf21 Mon Sep 17 00:00:00 2001 From: David Gault Date: Wed, 4 Oct 2023 14:53:34 +0100 Subject: [PATCH] Revert "revert getUsedFiles behaviour to remove skipPixels" This reverts commit 8aee5d81bc09f20fd9856498b157d4360e1bb9cb. # Conflicts: # src/loci/formats/in/ZarrReader.java --- src/loci/formats/in/ZarrReader.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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(); }