[gtk/image-loading: 2/3] Load jpegs without gdk-pixbuf
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/image-loading: 2/3] Load jpegs without gdk-pixbuf
- Date: Sun, 12 Sep 2021 14:56:41 +0000 (UTC)
commit ed00415d3084c142b4a51f2f1a77699c64ba3123
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Sep 11 17:02:41 2021 -0400
Load jpegs without gdk-pixbuf
Use our own loader for jpeg files.
gdk/gdktexture.c | 8 ++++++++
1 file changed, 8 insertions(+)
---
diff --git a/gdk/gdktexture.c b/gdk/gdktexture.c
index 19faea548b..37fd4d9c18 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
@@ -420,6 +421,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)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]