From 13f16feb81a8fd2510a406138971bd9a5db192b0 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 7 Apr 2015 12:21:01 +0200 Subject: fix gib_imlib_save_image_with_error_return in imported giblib code --- src/gib_imlib.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'src/gib_imlib.c') diff --git a/src/gib_imlib.c b/src/gib_imlib.c index b53b1cc..8f401aa 100644 --- a/src/gib_imlib.c +++ b/src/gib_imlib.c @@ -527,13 +527,22 @@ void gib_imlib_save_image_with_error_return(Imlib_Image im, char *file, Imlib_Load_Error * error_return) { - char *tmp; - - imlib_context_set_image(im); - tmp = strrchr(file, '.'); - if (tmp) - imlib_image_set_format(tmp + 1); - imlib_save_image_with_error_return(file, error_return); + char *tmp; + + imlib_context_set_image(im); + tmp = strrchr(file, '.'); + if (tmp) { + char *p, *pp; + p = estrdup(tmp + 1); + pp = p; + while(*pp) { + *pp = tolower(*pp); + pp++; + } + imlib_image_set_format(p); + free(p); + } + imlib_save_image_with_error_return(file, error_return); } void -- cgit v1.2.3