From ce67b2f160e93a9ecf4edc4ceef3746576f4ad17 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Sat, 5 Aug 2023 19:50:18 +0100 Subject: [PATCH] replace : by _ in name on Windows --- .../shoola/agents/imviewer/util/saver/ImgSaver.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/openmicroscopy/shoola/agents/imviewer/util/saver/ImgSaver.java b/src/main/java/org/openmicroscopy/shoola/agents/imviewer/util/saver/ImgSaver.java index c6285345c..a240fa443 100644 --- a/src/main/java/org/openmicroscopy/shoola/agents/imviewer/util/saver/ImgSaver.java +++ b/src/main/java/org/openmicroscopy/shoola/agents/imviewer/util/saver/ImgSaver.java @@ -396,7 +396,12 @@ String getExtendedName(String name, String format) */ String getPartialImageName() { - return UIUtilities.removeFileExtension(model.getImageName()); + String name = model.getImageName(); + if (UIUtilities.isWindowsOS()) { + // Special handling for NTFS ADS: Don't accept colon in the fileName. + name = name.replaceAll(":", "_"); + } + return UIUtilities.removeFileExtension(name); } /**