[gtk/image-loading: 45/70] Load jpegs without gdk-pixbuf
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/image-loading: 45/70] Load jpegs without gdk-pixbuf
- Date: Thu, 16 Sep 2021 01:12:47 +0000 (UTC)
commit a11cf4d43efb6021d71693dca27ae000e3148894
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 7784de49e6..a8ede20687 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]