diff --git a/ChangeLog b/ChangeLog index 8d511584..906693cb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,9 @@ - configure fails for requested but unmet dependencies [remicollet] - add support for another quantiser [DarthSim] +26/11/21 started 8.12.2 +- make exif resuint optional and default to inch + 21/11/21 started 8.12.1 - fix insert [chregu] diff --git a/libvips/foreign/exif.c b/libvips/foreign/exif.c index 12e40292..e7d08d6f 100644 --- a/libvips/foreign/exif.c +++ b/libvips/foreign/exif.c @@ -416,11 +416,15 @@ vips_image_resolution_from_exif( VipsImage *image, ExifData *ed ) */ if( vips_exif_entry_get_double( ed, 0, EXIF_TAG_X_RESOLUTION, &xres ) || vips_exif_entry_get_double( ed, - 0, EXIF_TAG_Y_RESOLUTION, &yres ) || - vips_exif_entry_get_int( ed, - 0, EXIF_TAG_RESOLUTION_UNIT, &unit ) ) + 0, EXIF_TAG_Y_RESOLUTION, &yres ) ) return( -1 ); + /* resuint is optional and defaults to inch. + */ + unit = 2; + (void) vips_exif_entry_get_int( ed, + 0, EXIF_TAG_RESOLUTION_UNIT, &unit ); + #ifdef DEBUG printf( "vips_image_resolution_from_exif: seen exif tags " "xres = %g, yres = %g, unit = %d\n", xres, yres, unit );