diff options
author | Olof-Joachim Frahm <olof@macrolet.net> | 2017-04-05 23:02:56 +0200 |
---|---|---|
committer | Olof-Joachim Frahm <olof@macrolet.net> | 2017-04-05 23:02:56 +0200 |
commit | 848c5f8aa4e55a6192bb39db234f8af4a63b2168 (patch) | |
tree | 5001ff51b093b2c4e7a918974eb38afa3019b699 /src/feh_png.c | |
parent | c42d55428b2a5c7ab1281aa9906cff2aaac50fe9 (diff) |
Use temporary file to create thumbnail.
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 *))) { |