diff --git a/ChangeLog b/ChangeLog index a09cafd4..90c64d68 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +4/11/14 started 7.42.0 +- better default resolution for png load + 25/7/14 started 7.41.0 - start working on --disable-deprecated - fix pngload with libpng >1.6.1 diff --git a/libvips/foreign/vipspng.c b/libvips/foreign/vipspng.c index e5cad2a7..d4149fdd 100644 --- a/libvips/foreign/vipspng.c +++ b/libvips/foreign/vipspng.c @@ -339,15 +339,15 @@ png2vips_header( Read *read, VipsImage *out ) /* If we're an INTEL byte order machine and this is 16bits, we need * to swap bytes. */ - if( bit_depth > 8 && !vips_amiMSBfirst() ) + if( bit_depth > 8 && + !vips_amiMSBfirst() ) png_set_swap( read->pPng ); - /* Get resolution. I'm not sure what we should do for UNKNOWN, since - * vips is always pixels/mm. + /* Get resolution. Default to 72 pixels per inch, the usual png value. */ unit_type = PNG_RESOLUTION_METER; - res_x = 1000; - res_y = 1000; + res_x = (72 / 2.54 * 100); + res_y = (72 / 2.54 * 100); png_get_pHYs( read->pPng, read->pInfo, &res_x, &res_y, &unit_type ); switch( unit_type ) { case PNG_RESOLUTION_METER: