summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-09-10 00:01:22 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-09-11 13:53:42 -0400
commit9d4f2414baf14db5e646633c2840490619461704 (patch)
tree0c1a6cfedba7dcff393b2214a119365b080b5fbd
parent1c8c852c1b9b56d1d3662b96c48a45dcabfc1dea (diff)
downloadgtk+-gamma-shenanigans.tar.gz
Load jpegs without gdk-pixbufgamma-shenanigans
Use our own loader for jpeg files.
-rw-r--r--gdk/gdktexture.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gdk/gdktexture.c b/gdk/gdktexture.c
index 48ed6c362e..d7c7206847 100644
--- a/gdk/gdktexture.c
+++ b/gdk/gdktexture.c
@@ -48,6 +48,7 @@
#include <graphene.h>
#include "gdkpng.h"
#include "gdktiff.h"
+#include "gdkjpeg.h"
/* HACK: So we don't need to include any (not-yet-created) GSK or GTK headers */
void
@@ -409,6 +410,13 @@ gdk_texture_new_from_file (GFile *file,
return texture;
}
+ if (memcmp (data, "\xff\xd8", 2) == 0)
+ {
+ texture = gdk_load_jpeg (stream, error);
+ g_object_unref (stream);
+ return texture;
+ }
+
pixbuf = gdk_pixbuf_new_from_stream (stream, NULL, error);
g_object_unref (stream);
if (pixbuf == NULL)