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
This commit is contained in:
John Cupitt 2017-01-04 09:22:32 +00:00
parent e7a6ea3d0c
commit 3a48ff9cc1
2 changed files with 8 additions and 5 deletions

View File

@ -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 "

View File

@ -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 )