[gtk/image-loading: 23/31] Load tiffs without gdk-pixbuf
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/image-loading: 23/31] Load tiffs without gdk-pixbuf
- Date: Sun, 12 Sep 2021 13:31:01 +0000 (UTC)
commit a7b9aa99a98c24deef28fec44bb740ef347de7de
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Sep 11 16:30:37 2021 -0400
Load tiffs without gdk-pixbuf
This will let us load floating point data, in
the future.
gdk/gdktexture.c | 9 +++++++++
1 file changed, 9 insertions(+)
---
diff --git a/gdk/gdktexture.c b/gdk/gdktexture.c
index b642c82ee3..dfda3b6513 100644
--- a/gdk/gdktexture.c
+++ b/gdk/gdktexture.c
@@ -47,6 +47,7 @@
#include <graphene.h>
#include "gdkpng.h"
+#include "gdktiff.h"
/* HACK: So we don't need to include any (not-yet-created) GSK or GTK headers */
void
@@ -411,6 +412,14 @@ gdk_texture_new_from_file (GFile *file,
return texture;
}
+ if (memcmp (data, "MM\x00\x2a", 4) == 0 ||
+ memcmp (data, "II\x2a\x00", 4) == 0)
+ {
+ texture = gdk_load_tiff (stream, error);
+ g_object_unref (stream);
+ return texture;
+ }
+
pixbuf = gdk_pixbuf_new_from_stream (stream, NULL, error);
g_object_unref (stream);
if (pixbuf == NULL)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]