From 881c6d72f5c87e57304694efc6664e2de47d09bd Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Wed, 2 Oct 2013 05:32:17 +0100 Subject: [PATCH] cosmetic --- ChangeLog | 2 ++ libvips/foreign/jpeg.h | 6 ++++-- libvips/foreign/vips2jpeg.c | 11 ++++++++--- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 17657849..9b26eaa2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -24,6 +24,8 @@ destination (basename is still there but deprecated) - new _UNBUFFERED sequential mode saves memory in some important cases - start vips_conv() as a simple wrapper over the old convolution functions +- new optimize_coding param for jpeg write produces optimal Huffman tables, + thanks Lovell 3/7/13 started 7.34.2 - lower priority for Matlab load to reduce segvs from Mat_Open(), thanks diff --git a/libvips/foreign/jpeg.h b/libvips/foreign/jpeg.h index 53abd6f1..e456161e 100644 --- a/libvips/foreign/jpeg.h +++ b/libvips/foreign/jpeg.h @@ -54,9 +54,11 @@ void vips__new_output_message( j_common_ptr cinfo ); void vips__new_error_exit( j_common_ptr cinfo ); int vips__jpeg_write_file( VipsImage *in, - const char *filename, int Q, const char *profile, gboolean optimize_coding ); + const char *filename, int Q, const char *profile, + gboolean optimize_coding ); int vips__jpeg_write_buffer( VipsImage *in, - void **obuf, size_t *olen, int Q, const char *profile, gboolean optimize_coding ); + void **obuf, size_t *olen, int Q, const char *profile, + gboolean optimize_coding ); int vips__isjpeg( const char *filename ); int vips__jpeg_read_file( const char *name, VipsImage *out, diff --git a/libvips/foreign/vips2jpeg.c b/libvips/foreign/vips2jpeg.c index 6e1a9fc1..a3f3e396 100644 --- a/libvips/foreign/vips2jpeg.c +++ b/libvips/foreign/vips2jpeg.c @@ -56,6 +56,8 @@ * - update exif image dimensions * 21/11/12 * - attach IPCT data (app13), thanks Gary + * 2/10/13 Lovell Fuller + * - add optimize_coding parameter */ /* @@ -847,7 +849,8 @@ write_jpeg_block( REGION *region, Rect *area, void *a ) /* Write a VIPS image to a JPEG compress struct. */ static int -write_vips( Write *write, int qfac, const char *profile, gboolean optimize_coding ) +write_vips( Write *write, int qfac, const char *profile, + gboolean optimize_coding ) { VipsImage *in; J_COLOR_SPACE space; @@ -946,7 +949,8 @@ write_vips( Write *write, int qfac, const char *profile, gboolean optimize_codin */ int vips__jpeg_write_file( VipsImage *in, - const char *filename, int Q, const char *profile, gboolean optimize_coding ) + const char *filename, int Q, const char *profile, + gboolean optimize_coding ) { Write *write; @@ -1222,7 +1226,8 @@ buf_dest( j_compress_ptr cinfo, void **obuf, size_t *olen ) int vips__jpeg_write_buffer( VipsImage *in, - void **obuf, size_t *olen, int Q, const char *profile, gboolean optimize_coding ) + void **obuf, size_t *olen, int Q, const char *profile, + gboolean optimize_coding ) { Write *write;