AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
April 2008

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2008.04.17 14:19 "Writing TIFF Group-4 file from array byte", by Filippo Trimoldi
2008.04.17 15:05 "Re: Writing TIFF Group-4 file from array byte", by Gerben Vos

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

Filippo Trimoldi wrote:

> 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.