| AWARE [SYSTEMS] | Imaging expertise for the Delphi developer | |||||||
![]() |
TIFF and LibTiff Mailing List Archive | |||||||
LibTiff Mailing List
TIFF and LibTiff Mailing List Archive Contact
The TIFF Mailing List Homepage |
Thread2006.04.02 22:16 "Re: WORDS_BIGENDIAN makes libtiff platform dependent", by Ping ShuJoris wrote:
> Still, one option is to detect it in the code by writing something to a
> word and reading back its first byte...
One exampel of run-time detection:
New code 3.8.2:
#ifdef WORDS_BIGENDIAN
tif->tif_header.tiff_magic = tif->tif_flags & TIFF_SWAB
? TIFF_LITTLEENDIAN : TIFF_BIGENDIAN;
#else
tif->tif_header.tiff_magic = tif->tif_flags & TIFF_SWAB
? TIFF_BIGENDIAN : TIFF_LITTLEENDIAN;
#endif
Old code 3.5
tif->tif_header.tiff_magic = tif->tif_flags & TIFF_SWAB
? (bigendian ? TIFF_LITTLEENDIAN : TIFF_BIGENDIAN)
: (bigendian ? TIFF_BIGENDIAN : TIFF_LITTLEENDIAN);
I think the old one is better. Mactel used to like the
3.5 libtiff.
Ping
|
|||||||