Wrong image size of JPG after TIFF to JPG conversion with JAI

R

Roland

Hello,

I am generating JPGs out of a TIFF from a fax server using JAI - the
problem is the strange dimension of the JPGs.

The TIFF contains for example 2 pages with size 1728 x 2382 (image
info from different image viewer).
The generated JPGs has both the size 1728 x 1131 ! The heigth is
wrong (almost half of original size) and the resulting JPG shows the
original page streched.

I am using the following code:

ImageDecoder dec = ImageCodec.createImageDecoder(
"tiff", new FileSeekableStream(new File(fnTiff)), null);
for (int i = 0; i < dec.getNumPages(); i++) {
RenderedOp op =
JAI.create(
"filestore", dec.decodeAsRenderedImage(i), i + ".jpg", "jpeg");
}

Where is the error? Do I have to define something more?


Any hints are welcome :)

Bye,
Roland.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top