Check for endianness.

* configure.in: Check for endianness.

	* io-tiff.c (tiff_image_parse): fix packing order on bigendian
	systems.  (#81702)
This commit is contained in:
Matthias Clasen
2002-05-18 14:54:37 +00:00
parent 410b70f907
commit 32931e7d08
9 changed files with 46 additions and 0 deletions

View File

@@ -1,3 +1,7 @@
2002-05-18 Matthias Clasen <maclas@gmx.de>
* configure.in: Check for endianness.
Thu May 16 19:49:24 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_configure_event): Only

View File

@@ -1,3 +1,7 @@
2002-05-18 Matthias Clasen <maclas@gmx.de>
* configure.in: Check for endianness.
Thu May 16 19:49:24 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_configure_event): Only

View File

@@ -1,3 +1,7 @@
2002-05-18 Matthias Clasen <maclas@gmx.de>
* configure.in: Check for endianness.
Thu May 16 19:49:24 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_configure_event): Only

View File

@@ -1,3 +1,7 @@
2002-05-18 Matthias Clasen <maclas@gmx.de>
* configure.in: Check for endianness.
Thu May 16 19:49:24 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_configure_event): Only

View File

@@ -1,3 +1,7 @@
2002-05-18 Matthias Clasen <maclas@gmx.de>
* configure.in: Check for endianness.
Thu May 16 19:49:24 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_configure_event): Only

View File

@@ -1,3 +1,7 @@
2002-05-18 Matthias Clasen <maclas@gmx.de>
* configure.in: Check for endianness.
Thu May 16 19:49:24 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_configure_event): Only

View File

@@ -500,6 +500,8 @@ AM_CONDITIONAL(HAVE_WINTAB, test x$have_wintab = xyes)
saved_cflags="$CFLAGS"
saved_ldflags="$LDFLAGS"
# check for bytesex stuff
AC_C_BIGENDIAN
# Checks for header files.
AC_HEADER_STDC

View File

@@ -1,3 +1,8 @@
2002-05-18 Matthias Clasen <maclas@gmx.de>
* io-tiff.c (tiff_image_parse): fix packing order on bigendian
systems. (#81702)
Thu May 16 15:17:30 2002 Owen Taylor <otaylor@redhat.com>
* pixops/pixops.c: Patch from Matthias Clasen to fix some typos

View File

@@ -268,6 +268,21 @@ tiff_image_parse (TIFF *tiff, TiffContext *context, GError **error)
TIFFRGBAImageGet (&img, (uint32 *)pixels, width, height);
TIFFRGBAImageEnd (&img);
#ifdef WORDS_BIGENDIAN
/* Turns out that the packing used by TIFFRGBAImage depends on the host byte order... */
while (pixels < pixbuf->pixels + bytes) {
uint32 pixel = *(uint32 *)pixels;
int r = TIFFGetR(pixel);
int g = TIFFGetG(pixel);
int b = TIFFGetB(pixel);
int a = TIFFGetA(pixel);
*pixels++ = r;
*pixels++ = g;
*pixels++ = b;
*pixels++ = a;
}
#endif
G_UNLOCK (tiff_loader);
if (context)
(* context->update_func) (pixbuf, 0, 0, width, height, context->user_data);