fix spngload default ppm

This commit is contained in:
John Cupitt 2020-07-15 10:56:34 +01:00
parent f7e8db599d
commit 36ac84ee6f
2 changed files with 4 additions and 4 deletions

View File

@ -198,8 +198,8 @@ vips_foreign_load_png_set_header( VipsForeignLoadPng *png, VipsImage *image )
/* Get resolution. Default to 72 pixels per inch.
*/
xres = (72.0 / 2.54 * 100.0);
yres = (72.0 / 2.54 * 100.0);
xres = 72.0 / 25.4;
yres = 72.0 / 25.4;
if( !spng_get_phys( png->ctx, &phys ) ) {
/* unit 1 means pixels per metre, otherwise unspecified.
*/

View File

@ -461,8 +461,8 @@ png2vips_header( Read *read, VipsImage *out )
/* Get resolution. Default to 72 pixels per inch, the usual png value.
*/
unit_type = PNG_RESOLUTION_METER;
res_x = (72 / 2.54 * 100);
res_y = (72 / 2.54 * 100);
res_x = 72.0 / 2.54 * 100.0;
res_y = 72.0 / 2.54 * 100.0;
png_get_pHYs( read->pPng, read->pInfo, &res_x, &res_y, &unit_type );
switch( unit_type ) {
case PNG_RESOLUTION_METER: