Login  Register

Re: TIFF encoder problems

Posted by Wayne Rasband on Apr 28, 2009; 2:36pm
URL: http://imagej.273.s1.nabble.com/TIFF-encoder-problems-tp3692760p3692761.html

> Dear ImageJ community,
>
> I noticed that the TIFF encoder for ImageJ defines fieldtype for the
> image height parameter as short.  I have been working with some long
> line scan data sets and reading them in as tiff.  Unfortunately, when
> I resave the data, the height parameter gets trucated to the first
> word of the actual height.  The data is still there, but upon
> rereading the data, it is truncated.  Does anyone know if this can be
> fixed or if there is another tiff encoder plugin that I can use?  For
> now I have simply changed the fieldType to 4 (long) in
> TiffEncoder.java and recompiled ImageJ.  Is there a problem with doing
> this?

The TiffEncoder in the ImageJ 1.42o daily build sets the field type to
4 (32-bit) for the ImageWidth and ImageLength tags. This should not be
a problem since the TIFF standard allows these tags to use either SHORT
(16-bit) or LONG (32-bit) field types. By using 32-bits, ImageJ can now
correctly save images that have a width or height greater than 65,535.

-wayne