Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variabledpi #110

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/main/java/net/sourceforge/tess4j/util/ImageIOHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make it final if it's constant.

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
Expand Down Expand Up @@ -589,8 +592,8 @@ public static void mergeTiff(List<IIOImage> 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.
Expand Down