From 6afad16d3da6c38b615271d4126c71e6ce5a9f1e Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sat, 12 Jul 2008 21:48:50 +0200 Subject: [PATCH] Fix so loading/saving from other stuff than stdin/stdout actually works. --- libqscale.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libqscale.c b/libqscale.c index 43fbaa2..c02aa1a 100644 --- a/libqscale.c +++ b/libqscale.c @@ -69,7 +69,7 @@ qscale_img *qscale_load_jpeg_from_stdio(FILE *file) struct jpeg_error_mgr jerr; dinfo.err = jpeg_std_error(&jerr); jpeg_create_decompress(&dinfo); - jpeg_stdio_src(&dinfo, stdin); + jpeg_stdio_src(&dinfo, file); jpeg_read_header(&dinfo, TRUE); dinfo.raw_data_out = TRUE; jpeg_start_decompress(&dinfo); @@ -573,7 +573,7 @@ int qscale_save_jpeg_to_stdio(const qscale_img *img, FILE *file, unsigned jpeg_q struct jpeg_error_mgr jerr; cinfo.err = jpeg_std_error(&jerr); jpeg_create_compress(&cinfo); - jpeg_stdio_dest(&cinfo, stdout); + jpeg_stdio_dest(&cinfo, file); cinfo.input_components = 3; jpeg_set_defaults(&cinfo); jpeg_set_quality(&cinfo, jpeg_quality, FALSE); -- 2.39.2