Only use mem-based io if it is supported
This commit is contained in:
committed by
Kornel
parent
7678cba140
commit
a4a721fce5
@@ -590,6 +590,7 @@ main (int argc, char **argv)
|
|||||||
/* Finish compression and release memory */
|
/* Finish compression and release memory */
|
||||||
jpeg_finish_compress(&dstinfo);
|
jpeg_finish_compress(&dstinfo);
|
||||||
|
|
||||||
|
#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)
|
||||||
if (jpeg_c_int_param_supported(&dstinfo, JINT_COMPRESS_PROFILE) &&
|
if (jpeg_c_int_param_supported(&dstinfo, JINT_COMPRESS_PROFILE) &&
|
||||||
jpeg_c_get_int_param(&dstinfo, JINT_COMPRESS_PROFILE)
|
jpeg_c_get_int_param(&dstinfo, JINT_COMPRESS_PROFILE)
|
||||||
== JCP_MAX_COMPRESSION) {
|
== JCP_MAX_COMPRESSION) {
|
||||||
@@ -611,6 +612,7 @@ main (int argc, char **argv)
|
|||||||
fprintf(stderr, "%s: can't write to stdout\n", progname);
|
fprintf(stderr, "%s: can't write to stdout\n", progname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
jpeg_destroy_compress(&dstinfo);
|
jpeg_destroy_compress(&dstinfo);
|
||||||
(void) jpeg_finish_decompress(&srcinfo);
|
(void) jpeg_finish_decompress(&srcinfo);
|
||||||
|
|||||||
Reference in New Issue
Block a user