summaryrefslogtreecommitdiff
path: root/src/imlib.c
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2012-09-12 19:45:58 +0200
committerDaniel Friesel <derf@finalrewind.org>2012-09-12 19:45:58 +0200
commit31c67831736e4bde3ef0d4dedb7c11dfc6649fdf (patch)
treecfbbb0904d41d8ac80aac3ab55f46a53f42be20c /src/imlib.c
parentd3709b893f6ba8657759ad981af79ac3740e1c71 (diff)
Proper workaround for broken gib_imlib_save_image_with_error_return
Diffstat (limited to 'src/imlib.c')
-rw-r--r--src/imlib.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/imlib.c b/src/imlib.c
index af7acdd..5e423f3 100644
--- a/src/imlib.c
+++ b/src/imlib.c
@@ -129,6 +129,32 @@ int feh_load_image_char(Imlib_Image * im, char *filename)
return(i);
}
+/*
+ * XXX gib_imlib_save_image_with_error_return breaks with *.END and
+ * similar because it tries to set the image format, which only works
+ * with .end .
+ * So we leave that part out.
+ */
+void ungib_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) {
+ char *p, *pp;
+ p = gib_estrdup(tmp + 1);
+ pp = p;
+ while(*pp) {
+ *pp = tolower(*pp);
+ pp++;
+ }
+ imlib_image_set_format(p);
+ gib_efree(p);
+ }
+ imlib_save_image_with_error_return(file, error_return);
+}
+
int feh_load_image(Imlib_Image * im, feh_file * file)
{
Imlib_Load_Error err;