From 0d97c78f0288f84bed1869ab45fd19b2279cf25a Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Tue, 3 Jan 2017 17:06:50 +0000 Subject: [PATCH 1/3] compat macro for early glibs --- libvips/include/vips/util.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libvips/include/vips/util.h b/libvips/include/vips/util.h index fb8fb2a6..027acb11 100644 --- a/libvips/include/vips/util.h +++ b/libvips/include/vips/util.h @@ -135,6 +135,14 @@ G_STMT_START { \ } \ } G_STMT_END +/* The g_info() macro was added in 2.40. + */ +#ifndef g_info +/* Hopefully we have varargs macros. Maybe revisit this. + */ +#define g_info(...) \ + g_log( G_LOG_DOMAIN, G_LOG_LEVEL_INFO, __VA_ARGS__ ) +#endif /* Various integer range clips. Record over/under flows. */ From e7a6ea3d0c25f0899388a167578ba6c5d49ca2f2 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Tue, 3 Jan 2017 17:12:42 +0000 Subject: [PATCH 2/3] oops! revert previous --- libvips/include/vips/util.h | 9 --------- 1 file changed, 9 deletions(-) diff --git a/libvips/include/vips/util.h b/libvips/include/vips/util.h index 027acb11..97fa0f3a 100644 --- a/libvips/include/vips/util.h +++ b/libvips/include/vips/util.h @@ -135,15 +135,6 @@ G_STMT_START { \ } \ } G_STMT_END -/* The g_info() macro was added in 2.40. - */ -#ifndef g_info -/* Hopefully we have varargs macros. Maybe revisit this. - */ -#define g_info(...) \ - g_log( G_LOG_DOMAIN, G_LOG_LEVEL_INFO, __VA_ARGS__ ) -#endif - /* Various integer range clips. Record over/under flows. */ #define VIPS_CLIP_UCHAR( V, SEQ ) \ From 3a48ff9cc1b5647632172386b00cd3e1d377c1bd Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Wed, 4 Jan 2017 09:22:32 +0000 Subject: [PATCH 3/3] don't warn for missing exif res don't warn for missing exif res (even though it should be there) since we fall back to jfif cs3 seems to avoid the exif res fields and just uses jfif see https://github.com/lovell/sharp/issues/657 --- libvips/foreign/jpeg2vips.c | 11 +++++++---- libvips/foreign/vips2jpeg.c | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/libvips/foreign/jpeg2vips.c b/libvips/foreign/jpeg2vips.c index 676ccd7e..4b1f111e 100644 --- a/libvips/foreign/jpeg2vips.c +++ b/libvips/foreign/jpeg2vips.c @@ -79,6 +79,8 @@ * 07/09/16 * - Don't use the exif resolution if x_resolution / y_resolution / * resolution_unit is missing + * 4/1/17 + * - Don't warn for missing exif res, since we fall back to jfif now */ /* @@ -574,11 +576,12 @@ res_from_exif( VipsImage *im, ExifData *ed ) */ if( get_entry_double( ed, 0, EXIF_TAG_X_RESOLUTION, &xres ) || get_entry_double( ed, 0, EXIF_TAG_Y_RESOLUTION, &yres ) || - get_entry_int( ed, 0, EXIF_TAG_RESOLUTION_UNIT, &unit ) ) { - vips_warn( "VipsJpeg", - "%s", _( "error reading resolution" ) ); + get_entry_int( ed, 0, EXIF_TAG_RESOLUTION_UNIT, &unit ) ) + /* Don't warn. There should be resolution info in the exif + * (according to the spec), but many images skip this and rely + * on silent fallback to the jfif resolution. + */ return( -1 ); - } #ifdef DEBUG printf( "res_from_exif: seen exif tags " diff --git a/libvips/foreign/vips2jpeg.c b/libvips/foreign/vips2jpeg.c index 9a6834b3..2bd0278c 100644 --- a/libvips/foreign/vips2jpeg.c +++ b/libvips/foreign/vips2jpeg.c @@ -455,7 +455,7 @@ write_tag( ExifData *ed, int ifd, ExifTag tag, write_fn fn, void *data ) /* This is different, we set the xres/yres from the vips header rather than * from the exif tags on the image metadata. * - * This is also called from the jpg reader to fix up bad exif resoltion. + * This is also called from the jpg reader to fix up bad exif resolution. */ int vips__set_exif_resolution( ExifData *ed, VipsImage *im )