New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot save images with capital letter extensions #51
Comments
The problem looks like in this: 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);
} 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)
if (!opt.quiet)
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);
if (err)
im_weprintf(win, "Can't save image %s:", tmpname); According to the imlib doc,
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 ( |
I'll merge the patch for now. 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. Yet again, thanks for the patch :) |
For example,
feh DSCxxxxx.JPG
can view the image. But when type 's' to save it, the console gives:
feh WARNING: Can't save image feh_xxxxxx_xxxxxx_DSCxxxxx.JPG: No such file or directory
The text was updated successfully, but these errors were encountered: