Comments (4)
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,
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.
from feh.
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.
from feh.
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.
from feh.
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 :)
from feh.
Related Issues (20)
- Image Loads with Progressive Zoom
- feh no longer reading keys file HOT 1
- failure to load or scan directory HOT 1
- rotate 180 corrupts image
- Data loss with `--unloadable` deleting files HOT 1
- Feature request: logging or printing of current filename HOT 1
- EXIF data for HEIC pictures HOT 1
- feh should request Full Screen to the window manager HOT 2
- One-background-per-display does not work with nvidia drivers + modesetting enabled
- Fully opaque images with alpha channel are rendered slightly transparent when zoomed out HOT 3
- Screen rotation in fullscreen mode causes pictures to be drawn in tile pattern
- double free when using --randomize with unloadable image file
- Allow for adding/removing actions from menu
- CWE-476: NULL Pointer Dereference in XPM Image Parser (ImLib2) HOT 1
- man page site doesn't render HOT 1
- Feature request: Get last file path viewed when exiting feh HOT 1
- Feature request: slideshow for wallpapers
- [Feature Request] Slideshow - Add auto-pan to slideshow HOT 1
- [Feature Request] Slideshow - Add transitions to slideshow
- App icon is not shown: what am I doing wrong?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from feh.