[gtk/image-loading: 11/18] Load jpegs without gdk-pixbuf
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/image-loading: 11/18] Load jpegs without gdk-pixbuf
- Date: Tue, 14 Sep 2021 11:57:19 +0000 (UTC)
commit 771f8bf88bdde4de8c074a638ee99c1a09c34476
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 | 6 ++++++
1 file changed, 6 insertions(+)
---
diff --git a/gdk/gdktexture.c b/gdk/gdktexture.c
index f42e25a4e5..0654d7a867 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"
G_DEFINE_QUARK (gdk-texture-error-quark, gdk_texture_error)
@@ -445,6 +446,11 @@ gdk_texture_new_from_bytes (GBytes *bytes,
{
return gdk_load_tiff (bytes, error);
}
+ else if (size > strlen (JPEG_SIGNATURE) &&
+ memcmp (data, JPEG_SIGNATURE, strlen (JPEG_SIGNATURE)) == 0)
+ {
+ return gdk_load_jpeg (bytes, error);
+ }
else
{
GInputStream *stream;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]