[libgxps] images: check the extension in lower case
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgxps] images: check the extension in lower case
- Date: Fri, 13 Jan 2017 20:10:39 +0000 (UTC)
commit cf8fef812409ab152e332e3ba5630f73c80a5a96
Author: Ignacio Casal Quinteiro <qignacio amazon com>
Date: Mon Jan 9 10:08:31 2017 +0100
images: check the extension in lower case
libgxps/gxps-images.c | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/libgxps/gxps-images.c b/libgxps/gxps-images.c
index cef2338..82de3c5 100644
--- a/libgxps/gxps-images.c
+++ b/libgxps/gxps-images.c
@@ -903,22 +903,27 @@ gxps_images_get_image (GXPSArchive *zip,
GError **error)
{
GXPSImage *image = NULL;
+ gchar *image_uri_lower;
/* First try with extensions,
* as it's recommended by the spec
* (2.1.5 Image Parts)
*/
- if (g_str_has_suffix (image_uri, ".png")) {
+ image_uri_lower = g_utf8_strdown (image_uri, -1);
+ if (g_str_has_suffix (image_uri_lower, ".png")) {
image = gxps_images_create_from_png (zip, image_uri, error);
- } else if (g_str_has_suffix (image_uri, ".jpg")) {
+ } else if (g_str_has_suffix (image_uri_lower, ".jpg")) {
image = gxps_images_create_from_jpeg (zip, image_uri, error);
- } else if (g_str_has_suffix (image_uri, ".tif")) {
+ } else if (g_str_has_suffix (image_uri_lower, ".tif")) {
image = gxps_images_create_from_tiff (zip, image_uri, error);
- } else if (g_str_has_suffix (image_uri, "wdp")) {
+ } else if (g_str_has_suffix (image_uri_lower, "wdp")) {
GXPS_DEBUG (g_message ("Unsupported image format windows media photo"));
+ g_free (image_uri_lower);
return NULL;
}
+ g_free (image_uri_lower);
+
if (!image) {
gchar *mime_type;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]