From e61ac98f90a660d0f4338893ae80661e17ed4984 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AB=B9=E5=86=85=20=E4=BC=B8=E4=B8=80?= Date: Tue, 17 Jul 2018 02:50:37 +0100 Subject: [PATCH 1/2] set output dpi changeable --- .../java/net/sourceforge/tess4j/util/ImageIOHelper.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/sourceforge/tess4j/util/ImageIOHelper.java b/src/main/java/net/sourceforge/tess4j/util/ImageIOHelper.java index b7a6b446..7c3ff003 100644 --- a/src/main/java/net/sourceforge/tess4j/util/ImageIOHelper.java +++ b/src/main/java/net/sourceforge/tess4j/util/ImageIOHelper.java @@ -63,6 +63,9 @@ public class ImageIOHelper { public static final String JAI_IMAGE_WRITER_MESSAGE = "Need to install JAI Image I/O package.\nhttps://github.com/jai-imageio/jai-imageio-core"; public static final String JAI_IMAGE_READER_MESSAGE = "Unsupported image format. May need to install JAI Image I/O package.\nhttps://github.com/jai-imageio/jai-imageio-core"; + public static int IMG_DPI_X = 300; + public static int IMG_DPI_Y = 300; + /** * Creates a list of TIFF image files from an image file. It basically * converts images of other formats to TIFF format, or a multi-page TIFF @@ -589,8 +592,8 @@ public static void mergeTiff(List imageList, File outputTiff, String c try (ImageOutputStream ios = ImageIO.createImageOutputStream(outputTiff)) { writer.setOutput(ios); - int dpiX = 300; - int dpiY = 300; + int dpiX = ImageIOHelper.IMG_DPI_X; + int dpiY = ImageIOHelper.IMG_DPI_Y; for (IIOImage iioImage : imageList) { // Get the default image metadata. From 8b3ccae6c6591b4b8fb58afa96251ddafc63f359 Mon Sep 17 00:00:00 2001 From: Cin TAKE Date: Wed, 25 Jul 2018 07:53:50 +0100 Subject: [PATCH 2/2] fix indent --- src/main/java/net/sourceforge/tess4j/util/ImageIOHelper.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/sourceforge/tess4j/util/ImageIOHelper.java b/src/main/java/net/sourceforge/tess4j/util/ImageIOHelper.java index 7c3ff003..6927e7f6 100644 --- a/src/main/java/net/sourceforge/tess4j/util/ImageIOHelper.java +++ b/src/main/java/net/sourceforge/tess4j/util/ImageIOHelper.java @@ -592,8 +592,8 @@ public static void mergeTiff(List imageList, File outputTiff, String c try (ImageOutputStream ios = ImageIO.createImageOutputStream(outputTiff)) { writer.setOutput(ios); - int dpiX = ImageIOHelper.IMG_DPI_X; - int dpiY = ImageIOHelper.IMG_DPI_Y; + int dpiX = ImageIOHelper.IMG_DPI_X; + int dpiY = ImageIOHelper.IMG_DPI_Y; for (IIOImage iioImage : imageList) { // Get the default image metadata.