You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The listed formats are all lower cases in imlib, I didn't check if imlibs would do anything to format string, I guess it's just do a simple compare, therefore "JPG" still != "jpg".
Here is a quick fix:
diff --git a/src/slideshow.c b/src/slideshow.c
index 6d39d2c..fb1fcc3 100644
--- a/src/slideshow.c+++ b/src/slideshow.c@@ -472,7 +472,8 @@ void slideshow_save_image(winwidget win)
printf("saving image to filename '%s'\n", tmpname);
- gib_imlib_save_image_with_error_return(win->im, tmpname, &err);+ imlib_context_set_image(win->im);+ imlib_save_image_with_error_return(tmpname, &err);
im_weprintf(win, "Can't save image %s:", tmpname);
According to the imlib doc,
EAPI void imlib_image_set_format ( const char * format )
Sets the format of the current image. This is used for when you wish to save an image in a different format that it was loaded in, or if the image currently has no file format associated with it.
I believe it has format associated already and it's same format as the original file, therefore those two lines have enough information for imlib to save image. I tested with JPG and PNG, I did get the saved files.
Tested and it works. Great. But are you sure that the format is always associated? If so, I think the function gib_imlib_save_image_with_error_return can be trimmed into 2 lines... Maybe the author can merge this into the master branch. Close it.
No, I am not sure. That's why I said "I believe." ;)
derf will review this. Maybe it's better to get to fix this (gib_imlib_save_image_with_error_return()) in giblib (but I don't feel it's still active), because there's the reason to use giblib, though you can directly call imlib to do the job.
It should be fixed in giblib, but it was created by the same author as feh, so it's unmaintained right now. And I don't think that particular bugfix is relevant for the two or three other existing programs using giblib.