private Thumbnail createThumbnail(InputStream inputStream, File thumbnailFile, int maxWidth, int maxHeight, long thumbId, String fileName) throws IOException, ThumbnailRenderException { final BufferedImage thumbnailImage = scaleImage(maxWidth, maxHeight, inputStream); final int height = thumbnailImage.getHeight(); final int width = thumbnailImage.getWidth(); storeImage(thumbnailImage, thumbnailFile); return new Thumbnail(height, width, fileName, thumbId, mimeType); }
private Thumbnail createThumbnail(InputStream originalFile, File thumbnailFile, int maxWidth, int maxHeight, long thumbId, String fileName) throws IOException, FileNotFoundException { // Load original image. Image originalImage = getImage(originalFile); // Create scaled buffered image from original image. BufferedImage scaledImage = scaleImage(originalImage, maxWidth, maxHeight); int height = scaledImage.getHeight(); int width = scaledImage.getWidth(); storeImage(scaledImage, thumbnailFile); return new Thumbnail(height, width, fileName, thumbId); }