[gtk/image-loading: 12/13] Load jpegs without gdk-pixbuf
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [gtk/image-loading: 12/13] Load jpegs without gdk-pixbuf
- Date: Mon, 13 Sep 2021 11:30:25 +0000 (UTC)
commit 6ab3501790c1ea7ef9df08f1b146e4439888bc5d
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 | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/gdk/gdktexture.c b/gdk/gdktexture.c
index f0de68edbc..82f5b61974 100644
--- a/gdk/gdktexture.c
+++ b/gdk/gdktexture.c
@@ -48,6 +48,7 @@
 #include <graphene.h>
 #include "loaders/gdkpngprivate.h"
 #include "loaders/gdktiffprivate.h"
+#include "loaders/gdkjpegprivate.h"
 
 /* HACK: So we don't need to include any (not-yet-created) GSK or GTK headers */
 void
@@ -402,7 +403,9 @@ gdk_texture_new_from_file (GFile   *file,
     texture = gdk_load_png (bytes, error);
   else if (memcmp (data, TIFF_SIGNATURE1, strlen (TIFF_SIGNATURE1)) == 0 ||
            memcmp (data, TIFF_SIGNATURE2, strlen (TIFF_SIGNATURE2)) == 0)
-      texture = gdk_load_tiff (bytes, error);
+    texture = gdk_load_tiff (bytes, error);
+  else if (memcmp (data, JPEG_SIGNATURE, strlen (JPEG_SIGNATURE)) == 0)
+    texture = gdk_load_jpeg (bytes, error);
   else
     {
       GInputStream *stream;
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]