summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@gnome.org>2018-05-14 18:15:06 -0500
committerFederico Mena Quintero <federico@gnome.org>2018-06-01 18:47:33 -0500
commita4238ae58f27f3bd503d102128aedbf9aa2d7f38 (patch)
tree3358aeeeaa68e563b3de592ccab63afed6829a2a
parent2bfa2936f71285143ccb6089cd32d409e15903be (diff)
downloadgdk-pixbuf-a4238ae58f27f3bd503d102128aedbf9aa2d7f38.tar.gz
io-tiff.c: Don't use gdk-pixbuf-private.h
-rw-r--r--gdk-pixbuf/io-tiff.c40
1 files changed, 25 insertions, 15 deletions
diff --git a/gdk-pixbuf/io-tiff.c b/gdk-pixbuf/io-tiff.c
index 607d2e325..5eb1b2614 100644
--- a/gdk-pixbuf/io-tiff.c
+++ b/gdk-pixbuf/io-tiff.c
@@ -35,7 +35,11 @@
#endif
#include <tiffio.h>
#include <errno.h>
-#include "gdk-pixbuf-private.h"
+#include <glib-object.h>
+#include <glib/gi18n-lib.h>
+
+#include "gdk-pixbuf-core.h"
+#include "gdk-pixbuf-io.h"
#include "fallback-c89.c"
#ifdef G_OS_WIN32
@@ -290,20 +294,26 @@ tiff_image_parse (TIFF *tiff, TiffContext *context, GError **error)
gdk_pixbuf_set_option (pixbuf, "multipage", "yes");
#if G_BYTE_ORDER == G_BIG_ENDIAN
- /* 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;
- }
+ {
+ guchar *pixbuf_pixels = gdk_pixbuf_get_pixels (pixbuf);
+
+ pixels = pixbuf_pixels;
+
+ /* 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
if (context && context->update_func)