From cc042d8861385d2cf393834a37831d0cec8a1055 Mon Sep 17 00:00:00 2001 From: Melissa Linkert Date: Fri, 9 Dec 2016 10:03:45 -0600 Subject: [PATCH] Revert PixelsProcessor changes so that naming for Images is unchanged --- .../src/ome/formats/model/PixelsProcessor.java | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/components/blitz/src/ome/formats/model/PixelsProcessor.java b/components/blitz/src/ome/formats/model/PixelsProcessor.java index 1faa8fa9a5e..8270fc74836 100644 --- a/components/blitz/src/ome/formats/model/PixelsProcessor.java +++ b/components/blitz/src/ome/formats/model/PixelsProcessor.java @@ -125,8 +125,6 @@ public void process(IObjectContainerStore store) throws ModelException { } // Ensure that the Image name is set - - // name supplied by user String userSpecifiedName = store.getUserSpecifiedName(); if (userSpecifiedName != null) { userSpecifiedName = userSpecifiedName.trim(); @@ -134,9 +132,11 @@ public void process(IObjectContainerStore store) throws ModelException { userSpecifiedName = null; } } - // name that will actually be set on the Image + if (userSpecifiedName == null) { + File originalFile = new File(reader.getCurrentFile()); + userSpecifiedName = originalFile.getName(); + } String saveName = ""; - // name supplied by the reader String imageName; if (image.getName() != null && image.getName().getValue() != null) { imageName = image.getName().getValue().trim(); @@ -155,17 +155,9 @@ public void process(IObjectContainerStore store) throws ModelException { } saveName += " [" + imageName + "]"; } - } else if (imageName != null) { + } else { saveName = imageName; } - else { - saveName = reader.getCurrentFile(); - saveName = saveName.substring(saveName.lastIndexOf(File.separator) + 1); - if (reader.getSeriesCount() > 1) { - saveName += " [" + imageIndex + "]"; - } - } - // TODO: remove this if/when name is switched to TEXT in the DB if (saveName != null && saveName.length() > 255) { saveName = '…' + saveName.substring(saveName.length() - 254); }