]> git.sesse.net Git - qscale/commitdiff
Fix so loading/saving from other stuff than stdin/stdout actually works.
authorSteinar H. Gunderson <sesse@debian.org>
Sat, 12 Jul 2008 19:48:50 +0000 (21:48 +0200)
committerSteinar H. Gunderson <sesse@debian.org>
Sat, 12 Jul 2008 19:48:50 +0000 (21:48 +0200)
libqscale.c

index 43fbaa27e38dc1de8ec029dddb0f7b0fa5350dfd..c02aa1a58ee685471f2a0fa31157341ea363432c 100644 (file)
@@ -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);