default JFIF res to 72dpi

We were 1ppm before. 72dpi is the EXIF default.
This commit is contained in:
John Cupitt 2020-05-13 14:34:59 +01:00
parent 5549175b5e
commit ffa10eb148
2 changed files with 5 additions and 6 deletions

View File

@ -418,10 +418,8 @@ vips_image_resolution_from_exif( VipsImage *image, ExifData *ed )
switch( unit ) {
case 1:
/* No unit ... just pass the fields straight to vips.
/* No units, instead xres / yres gives the pixel aspect ratio.
*/
vips_image_set_string( image,
VIPS_META_RESOLUTION_UNIT, "none" );
break;
case 2:

View File

@ -506,10 +506,11 @@ read_jpeg_header( ReadJpeg *jpeg, VipsImage *out )
break;
}
/* Get the jfif resolution. exif may overwrite this later.
/* Get the jfif resolution. exif may overwrite this later. Default to
* 72dpi (as EXIF does).
*/
xres = 1.0;
yres = 1.0;
xres = 72.0 / 25.4;
yres = 72.0 / 25.4;
if( cinfo->saw_JFIF_marker &&
cinfo->X_density != 1U &&
cinfo->Y_density != 1U ) {