From 97367b465e73ec8595ac21b840fef198e243f185 Mon Sep 17 00:00:00 2001 From: Bob Friesenhahn Date: Thu, 3 Feb 2005 19:46:49 +0000 Subject: [PATCH] * tools/tiffgt.c: Fix problem on big-endian CPUs so that images display more correctly. Images display brighter than they should on a Sun workstation. --- ChangeLog | 6 ++++++ tools/tiffgt.c | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7716b270..c7a03b01 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-02-03 Bob Friesenhahn + + * tools/tiffgt.c: Fix problem on big-endian CPUs so that images + display more correctly. Images display brighter than they should + on a Sun workstation. + 2005-02-03 Andrey Kiselev * libtiff/tif_dirread.c: Estimate strip size in case of wrong or diff --git a/tools/tiffgt.c b/tools/tiffgt.c index e31c950c..4f810669 100644 --- a/tools/tiffgt.c +++ b/tools/tiffgt.c @@ -1,4 +1,4 @@ -/* $Id: tiffgt.c,v 1.2 2004-09-12 16:40:40 bfriesen Exp $ */ +/* $Id: tiffgt.c,v 1.3 2005-02-03 19:46:49 bfriesen Exp $ */ /* * Copyright (c) 1988-1997 Sam Leffler @@ -222,6 +222,9 @@ initImage(void) height = h; } TIFFRGBAImageGet(&img, raster, img.width, img.height); +#if HOST_BIGENDIAN + TIFFSwabArrayOfLong(raster,img.width*img.height); +#endif } static int @@ -263,7 +266,7 @@ setWindowSize(void) static void raster_draw(void) { - glDrawPixels(img.width, img.height, GL_RGBA, GL_UNSIGNED_BYTE, raster); + glDrawPixels(img.width, img.height, GL_RGBA, GL_UNSIGNED_BYTE, (const GLvoid *) raster); } static void