From 63527412d1b0d9ea7925982b15e4821557a9787b Mon Sep 17 00:00:00 2001 From: Melissa Linkert Date: Wed, 2 Oct 2024 11:30:56 -0500 Subject: [PATCH] Operetta reader: don't add directories to the used files list --- .../src/loci/formats/in/OperettaReader.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/components/formats-gpl/src/loci/formats/in/OperettaReader.java b/components/formats-gpl/src/loci/formats/in/OperettaReader.java index 15db568d5ab..f6b89db3df4 100644 --- a/components/formats-gpl/src/loci/formats/in/OperettaReader.java +++ b/components/formats-gpl/src/loci/formats/in/OperettaReader.java @@ -350,10 +350,16 @@ protected void initFile(String id) throws FormatException, IOException { LOGGER.trace("Found folder {}", folder); if (!checkSuffix(folder, "tiff")) { - String metadataFile = new Location(path, folder).getAbsolutePath(); - if (!metadataFile.equals(currentFile.getAbsolutePath())) { - metadataFiles.add(metadataFile); - LOGGER.trace("Adding metadata file {}", metadataFile); + Location metadataLocation = new Location(path, folder); + if (!metadataLocation.isDirectory()) { + String metadataFile = metadataLocation.getAbsolutePath(); + if (!metadataFile.equals(currentFile.getAbsolutePath())) { + metadataFiles.add(metadataFile); + LOGGER.trace("Adding metadata file {}", metadataFile); + } + } + else { + LOGGER.debug("Skipping metadata folder {}", metadataLocation); } } }