Skip to content

Commit

Permalink
Revert PixelsProcessor changes so that naming for Images is unchanged
Browse files Browse the repository at this point in the history
  • Loading branch information
melissalinkert committed Dec 9, 2016
1 parent 94575d5 commit cc042d8
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions components/blitz/src/ome/formats/model/PixelsProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,18 +125,18 @@ 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();
if (userSpecifiedName.isEmpty()) {
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();
Expand All @@ -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);
}
Expand Down

0 comments on commit cc042d8

Please sign in to comment.