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
July 1998

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!



1998.07.24 22:24 "Tiff viewer", by John Xu

Hi, all:
Forgive me if I send this email to wrong group but I don't know other
group related to tiff.

Does somebody know where we can good tiff viewers for Mac and Unix?

Thanks

Tom Lane wrote:

> I believe that tiffdump contains a fundamental byte-swapping error.
>
> Consider the situation where a field contains two SHORT values.
> The data fits in 4 bytes and thus will appear directly in the
> IFD value/offset field.  If the file was written by a littleendian
> machine and is being read on a bigendian machine, we want to swap
> bytes in the two individual SHORTs, but maintain their order.
>
> tiffdump gets it wrong, and ends up printing the two SHORT values
> in the wrong order.
>
> Attached is a sample little-endian file which exhibits the error when
> inspected on a bigendian machine.  The YCbCrSubsampling field contains
> 2,1.  The library gets this right (eg, tiffinfo prints the right thing);
> but tiffdump says:
>
> YCbCrSubsampling (530) SHORT (3) 2<1 2>
>
> which is disastrously wrong.
>
> I think the correct way to fix this is not to apply TIFFSwabArrayOfLong
> to the value field right away in ReadDirectory, but to wait and apply
> the proper Swab routine *after* determining the element size.  The
> PrintByte and PrintShort routines are wrong too: they should be acting
> on the basis of the local machine's endianness, not the file's.
>
>                         regards, tom lane
>
>   ------------------------------------------------------------------------
>
>                      Type: TIFF Image (image/tiff)
>    Part 1.2      Encoding: Base64
>               Description: ds300_exif.tiff



--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
John Xu
Centuple Communications, Inc.    john.xu@worldnet.att.net
3989 Central Ave. NE.
Mail Stop 16                     Tel: 612 789-3119
Minneapolis, MN 55421            Fax: 612 789-2013