Skip to content

Commit

Permalink
Merge pull request #4267 from sbesson/fujireader_getcurrentfile
Browse files Browse the repository at this point in the history
FujiReader: ensure getCurrentFile is the first element of the used files list
  • Loading branch information
melissalinkert authored Jan 21, 2025
2 parents d752efc + f7230ae commit 047935b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
15 changes: 6 additions & 9 deletions components/formats-gpl/src/loci/formats/in/FujiReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -142,17 +142,14 @@ public void close(boolean fileOnly) throws IOException {
/* @see loci.formats.FormatReader#initFile(String) */
@Override
protected void initFile(String id) throws FormatException, IOException {
super.initFile(id);

if (checkSuffix(id, "inf")) {
infFile = new Location(id).getAbsolutePath();
pixelsFile = infFile.substring(0, infFile.lastIndexOf(".")) + ".img";
}
else {
pixelsFile = new Location(id).getAbsolutePath();
infFile = pixelsFile.substring(0, pixelsFile.lastIndexOf(".")) + ".inf";
if (!checkSuffix(id, "inf")) {
initFile(id.substring(0, id.lastIndexOf(".")) + ".inf");
return;
}

super.initFile(id);
infFile = new Location(id).getAbsolutePath();
pixelsFile = infFile.substring(0, infFile.lastIndexOf(".")) + ".img";
String[] lines = DataTools.readFile(infFile).split("\r{0,1}\n");

int bits = Integer.parseInt(lines[5]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1871,7 +1871,6 @@ public void testSaneUsedFiles() {
!(reader.getFormat().equals("Evotec Flex")) &&
!(reader.getFormat().equals("CellSens VSI")) &&
!(reader.getFormat().equals("PerkinElmer")) &&
!(reader.getFormat().equals("Fuji LAS 3000")) &&
!(reader.getFormat().equals("Micro-Manager")) &&
!(reader.getFormat().equals("BDV")) &&
!(reader.getFormat().equals("Zeiss AxioVision TIFF")) &&
Expand Down

0 comments on commit 047935b

Please sign in to comment.