Blame SOURCES/libgxps-0.3.0-clear-error.patch
|
|
b2ba33 |
From 672c65ea8cbd2bcfd82a6b6498a4f1eb9daf5ec5 Mon Sep 17 00:00:00 2001
|
|
|
b2ba33 |
From: Carlos Garcia Campos <carlosgc@gnome.org>
|
|
|
b2ba33 |
Date: Fri, 8 Dec 2017 11:20:25 +0100
|
|
|
b2ba33 |
Subject: [PATCH 2/2] gxps-images: clear the error before trying to load an
|
|
|
b2ba33 |
image again
|
|
|
b2ba33 |
|
|
|
b2ba33 |
In gxps_images_get_image() we first try with the image file extension,
|
|
|
b2ba33 |
and if that fails then we try guessing the content type. If the image
|
|
|
b2ba33 |
load failed the first time, the GError might be filled already, so we
|
|
|
b2ba33 |
need to clear it before passing it to create functions again.
|
|
|
b2ba33 |
---
|
|
|
b2ba33 |
libgxps/gxps-images.c | 2 ++
|
|
|
b2ba33 |
1 file changed, 2 insertions(+)
|
|
|
b2ba33 |
|
|
|
b2ba33 |
diff --git a/libgxps/gxps-images.c b/libgxps/gxps-images.c
|
|
|
b2ba33 |
index 19cb1c0..4dcf9e2 100644
|
|
|
b2ba33 |
--- a/libgxps/gxps-images.c
|
|
|
b2ba33 |
+++ b/libgxps/gxps-images.c
|
|
|
b2ba33 |
@@ -925,6 +925,8 @@ gxps_images_get_image (GXPSArchive *zip,
|
|
|
b2ba33 |
if (!image) {
|
|
|
b2ba33 |
gchar *mime_type;
|
|
|
b2ba33 |
|
|
|
b2ba33 |
+ g_clear_error(error);
|
|
|
b2ba33 |
+
|
|
|
b2ba33 |
mime_type = gxps_images_guess_content_type (zip, image_uri);
|
|
|
b2ba33 |
if (g_strcmp0 (mime_type, "image/png") == 0) {
|
|
|
b2ba33 |
image = gxps_images_create_from_png (zip, image_uri, error);
|
|
|
b2ba33 |
--
|
|
|
b2ba33 |
2.17.1
|
|
|
b2ba33 |
|