diff --git a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/Hdf5ThumbnailGenerator.java b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/Hdf5ThumbnailGenerator.java index 91e3ccb1b2e8d65e3f2ebe2e24957691944948e6..3a5c3daa77438b2b3e701fbaf03b5a1f981c5622 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/Hdf5ThumbnailGenerator.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/Hdf5ThumbnailGenerator.java @@ -347,9 +347,7 @@ public class Hdf5ThumbnailGenerator implements IHDF5WriterClient { if ((imageDataSetStructure.getChannelColorComponents() != null && imageDataSetStructure .getChannelColorComponents().size() > 0) - || transformationsForChannels.get(imageFileInfo.getChannelCode()).containsKey( - thumbnailsStorageFormat.getTransformationCode(imageFileInfo - .getChannelCode()))) + || isTransformationAvailable(imageFileInfo.getChannelCode())) { List<ThumbnailData> thumbnails = new ArrayList<ThumbnailData>(); for (String channelCode : getChannelsToProcess(imageFileInfo.getChannelCode())) @@ -379,6 +377,16 @@ public class Hdf5ThumbnailGenerator implements IHDF5WriterClient } } + private boolean isTransformationAvailable(String channelCode) + { + Map<String, ImageTransformation> transformationsForChannel = + transformationsForChannels.get(channelCode); + + return transformationsForChannel != null + && transformationsForChannel.containsKey(thumbnailsStorageFormat + .getTransformationCode(channelCode)); + } + private List<ThumbnailData> generateThumbnailInternally(ImageFileInfo imageFileInfo, String imageIdOrNull, ByteArrayOutputStream bufferOutputStream) throws IOException { @@ -467,9 +475,12 @@ public class Hdf5ThumbnailGenerator implements IHDF5WriterClient thumbnailsStorageFormat.getTransformationCode(channelCode); if (transformationCodeOrNull != null) { + Map<String, ImageTransformation> transformationsForChannel = + transformationsForChannels.get(channelCode); + ImageTransformation it = - transformationsForChannels.get(channelCode).get( - transformationCodeOrNull.toUpperCase()); + transformationsForChannel == null ? null : transformationsForChannel + .get(transformationCodeOrNull.toUpperCase()); if (it != null) { return it.getImageTransformerFactory().createTransformer();