diff options
author | Daniel Friesel <derf@finalrewind.org> | 2017-04-16 18:08:48 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2017-04-16 18:08:48 +0200 |
commit | b79cb3cf073ccf5fac8075ec7e8263852ebc3e14 (patch) | |
tree | 9ac369fd32c9103172d4c16b2307304f9352be05 /src/feh_png.c | |
parent | 1535aed1c450cf45cdaf1dad76e2a2e6cb0aae6f (diff) | |
parent | a22f14528deeee8d3ee2795f0eeef305785c964c (diff) |
Merge branch 'Ferada-xdg-thumbnails'
Diffstat (limited to 'src/feh_png.c')
-rw-r--r-- | src/feh_png.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/feh_png.c b/src/feh_png.c index 129eb45..ff73f56 100644 --- a/src/feh_png.c +++ b/src/feh_png.c @@ -94,7 +94,7 @@ gib_hash *feh_png_read_comments(char *file) } /* grab image data from image and write info file with comments ... */ -int feh_png_write_png(Imlib_Image image, char *file, ...) +int feh_png_write_png_fd(Imlib_Image image, int fd, ...) { FILE *fp; int i, w, h; @@ -111,7 +111,7 @@ int feh_png_write_png(Imlib_Image image, char *file, ...) char *pair_key, *pair_text; #endif /* PNG_TEXT_SUPPORTED */ - if (!(fp = fopen(file, "wb"))) + if (!(fp = fdopen(fd, "wb"))) return 0; png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); @@ -155,7 +155,7 @@ int feh_png_write_png(Imlib_Image image, char *file, ...) png_set_sBIT(png_ptr, info_ptr, &sig_bit); #ifdef PNG_TEXT_SUPPORTED - va_start(args, file); + va_start(args, fd); for (i = 0; i < FEH_PNG_NUM_COMMENTS; i++) { if ((pair_key = va_arg(args, char *)) && (pair_text = va_arg(args, char *))) { |