--- configure.in.orig	Thu May 16 22:52:00 2002
+++ configure.in	Thu May 16 22:52:59 2002
@@ -508,6 +508,8 @@
 saved_cflags="$CFLAGS"
 saved_ldflags="$LDFLAGS"
 
+# check for bytesex stuff
+AC_C_BIGENDIAN
 
 # Checks for header files.
 AC_HEADER_STDC
--- gdk-pixbuf/io-tiff.c.orig	Thu May 16 23:04:01 2002
+++ gdk-pixbuf/io-tiff.c	Thu May 16 23:03:45 2002
@@ -268,6 +268,21 @@
         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);
