Source:
<code>protected PictureView computeView(DocumentModel doc, Blob blob, PictureConversion pictureConversion, ImageInfo imageInfo) { String title = pictureConversion.getId(); Map<String, Serializable> pictureViewMap = new HashMap<>(); pictureViewMap.put(PictureView.FIELD_TITLE, title); pictureViewMap.put(PictureView.FIELD_DESCRIPTION, pictureConversion.getDescription()); pictureViewMap.put(PictureView.FIELD_TAG, pictureConversion.getTag()); Point size = new Point(imageInfo.getWidth(), imageInfo.getHeight()); if (pictureConversion.getMaxSize() != null) { size = ImageResizer.scaleToMax(size.x, size.y, pictureConversion.getMaxSize()); } String conversionFormat = getConfigurationValue(CONVERSION_FORMAT, JPEG_CONVERSATION_FORMAT); Blob viewBlob = callPictureConversionChain(doc, blob, pictureConversion, imageInfo, size, conversionFormat); String extension = FilenameUtils.getExtension(viewBlob.getFilename()); if (StringUtils.isEmpty(extension)) { MimetypeRegistry mimetypeRegistry = Framework.getService(MimetypeRegistry.class); List<String> extensions = mimetypeRegistry.getExtensionsFromMimetypeName(viewBlob.getMimeType()); if (extensions != null && !extensions.isEmpty()) { extension = extensions.get(0); } } String viewFilename = String.format("%s_%s.%s", title, FilenameUtils.getBaseName(blob.getFilename()), extension); viewBlob.setFilename(viewFilename); ImageInfo viewBlobImageInfo = getImageInfo(viewBlob); pictureViewMap.put(PictureView.FIELD_FILENAME, viewFilename); pictureViewMap.put(PictureView.FIELD_CONTENT, (Serializable) viewBlob); pictureViewMap.put(PictureView.FIELD_INFO, viewBlobImageInfo); pictureViewMap.put(PictureView.FIELD_WIDTH, viewBlobImageInfo.getWidth()); pictureViewMap.put(PictureView.FIELD_HEIGHT, viewBlobImageInfo.getHeight()); <START> <END> return new PictureViewImpl(pictureViewMap); }</code><technical_language>getImageInfo returns a null i add control viewBlobImageInfo avoid NPE break changes</technical_language>

Target:
protected PictureView computeView(DocumentModel doc, Blob blob, PictureConversion pictureConversion, ImageInfo imageInfo) { String title = pictureConversion.getId(); Map<String, Serializable> pictureViewMap = new HashMap<>(); pictureViewMap.put(PictureView.FIELD_TITLE, title); pictureViewMap.put(PictureView.FIELD_DESCRIPTION, pictureConversion.getDescription()); pictureViewMap.put(PictureView.FIELD_TAG, pictureConversion.getTag()); Point size = new Point(imageInfo.getWidth(), imageInfo.getHeight()); if (pictureConversion.getMaxSize() != null) { size = ImageResizer.scaleToMax(size.x, size.y, pictureConversion.getMaxSize()); } String conversionFormat = getConfigurationValue(CONVERSION_FORMAT, JPEG_CONVERSATION_FORMAT); Blob viewBlob = callPictureConversionChain(doc, blob, pictureConversion, imageInfo, size, conversionFormat); String extension = FilenameUtils.getExtension(viewBlob.getFilename()); if (StringUtils.isEmpty(extension)) { MimetypeRegistry mimetypeRegistry = Framework.getService(MimetypeRegistry.class); List<String> extensions = mimetypeRegistry.getExtensionsFromMimetypeName(viewBlob.getMimeType()); if (extensions != null && !extensions.isEmpty()) { extension = extensions.get(0); } } String viewFilename = String.format("%s_%s.%s", title, FilenameUtils.getBaseName(blob.getFilename()), extension); viewBlob.setFilename(viewFilename); ImageInfo viewBlobImageInfo = getImageInfo(viewBlob); pictureViewMap.put(PictureView.FIELD_FILENAME, viewFilename); pictureViewMap.put(PictureView.FIELD_CONTENT, (Serializable) viewBlob); pictureViewMap.put(PictureView.FIELD_INFO, viewBlobImageInfo); if (viewBlobImageInfo != null){ pictureViewMap.put(PictureView.FIELD_WIDTH, viewBlobImageInfo.getWidth()); pictureViewMap.put(PictureView.FIELD_HEIGHT, viewBlobImageInfo.getHeight()); } return new PictureViewImpl(pictureViewMap); }