2008.04.17 14:19 "[Tiff] Writing TIFF Group-4 file from array byte", by Filippo Trimoldi

2008.04.17 15:05 "Re: [Tiff] Writing TIFF Group-4 file from array byte", by Gerben Vos

With Java Morena Framework (an Image Acquisition Framework for Java) I've a
ImageConsumer object that give me a byte Array with size equal to
width*height that I need to write in a Tiff

> group-4 image with LibTiff through a JNI. In the C side I

perform this code with my byte Array:

The byte array size should be ceil(width / 8) * height, because There are 8 bits in a byte.

TIFFWriteEncodedStrip(image, 0, <array byte that comes from java>, arraySize);

The rest of your code looks OK. You are leaving out the interesting information...

But the consequent image is wrong. It's seems to be resized on the X axis
but anyway it's wrong.
I noticed that my array that comes from Java it's a simple sequence of 0-1
(probably coming from scanner in this format) of (width*height) lenght.

The values of the bytes should generally be between 0 and 255. Unless it's some kind of Java bit array that I don't know (I don't know much Java).

Gerben Vos.

--

Please reply to the list, not to me personally.