From 6d29af7f723a39db8428fd670c59ec19f8ffbc35 Mon Sep 17 00:00:00 2001 From: Yoshihiro OKUMURA Date: Thu, 29 Sep 2022 19:02:49 +0900 Subject: [PATCH] change access privileges to public for resize() method. --- .../riken/neurodata/tools/BioFormatsImageThumbnail.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/jp/riken/neurodata/tools/BioFormatsImageThumbnail.java b/src/main/java/jp/riken/neurodata/tools/BioFormatsImageThumbnail.java index 7c0f880..3d78357 100644 --- a/src/main/java/jp/riken/neurodata/tools/BioFormatsImageThumbnail.java +++ b/src/main/java/jp/riken/neurodata/tools/BioFormatsImageThumbnail.java @@ -31,7 +31,7 @@ public class BioFormatsImageThumbnail { protected static final int BACKGROUND_COLOR = 0x000000; protected static final double MAXIMUM_SCALE = 2.0; - protected static BufferedImage resize(final BufferedImage image, final int width, final int height) { + public static BufferedImage resize(final BufferedImage image, final int width, final int height) { final boolean hasAlpha = image.getColorModel().hasAlpha(); final int imageWidth = image.getWidth(); final int imageHeight = image.getHeight(); @@ -46,7 +46,7 @@ public class BioFormatsImageThumbnail { int resizeHeight = imageHeight; Image resizeImage = image; if (scale != 1.0) { - // resize image if dimension is larger than maximum dimention. + // resize image if dimension is different with requrested dimension. resizeWidth = (int) (scale * (double) imageWidth); resizeHeight = (int) (scale * (double) imageHeight); resizeImage = image.getScaledInstance(resizeWidth, resizeHeight, Image.SCALE_AREA_AVERAGING); @@ -242,8 +242,8 @@ public class BioFormatsImageThumbnail { final String format = image.getColorModel().hasAlpha() ? "png" : "jpeg"; // image = resize(image, 160, 160); final String dataUri = getDataUri(image, "image/" + format); - // System.out.println(dataUri); - saveFile(dataUri, "/var/tmp/thumbnail." + format); + System.out.println(dataUri); + // saveFile(dataUri, "/var/tmp/thumbnail." + format); } catch (final BioFormatsImageException e) { System.out.println(e.getMessage()); System.exit(1);