better default resolution for png load
see https://github.com/lovell/sharp/issues/96
This commit is contained in:
parent
5995fff130
commit
cfcd819246
@ -1,3 +1,6 @@
|
|||||||
|
4/11/14 started 7.42.0
|
||||||
|
- better default resolution for png load
|
||||||
|
|
||||||
25/7/14 started 7.41.0
|
25/7/14 started 7.41.0
|
||||||
- start working on --disable-deprecated
|
- start working on --disable-deprecated
|
||||||
- fix pngload with libpng >1.6.1
|
- fix pngload with libpng >1.6.1
|
||||||
|
@ -339,15 +339,15 @@ png2vips_header( Read *read, VipsImage *out )
|
|||||||
/* If we're an INTEL byte order machine and this is 16bits, we need
|
/* If we're an INTEL byte order machine and this is 16bits, we need
|
||||||
* to swap bytes.
|
* to swap bytes.
|
||||||
*/
|
*/
|
||||||
if( bit_depth > 8 && !vips_amiMSBfirst() )
|
if( bit_depth > 8 &&
|
||||||
|
!vips_amiMSBfirst() )
|
||||||
png_set_swap( read->pPng );
|
png_set_swap( read->pPng );
|
||||||
|
|
||||||
/* Get resolution. I'm not sure what we should do for UNKNOWN, since
|
/* Get resolution. Default to 72 pixels per inch, the usual png value.
|
||||||
* vips is always pixels/mm.
|
|
||||||
*/
|
*/
|
||||||
unit_type = PNG_RESOLUTION_METER;
|
unit_type = PNG_RESOLUTION_METER;
|
||||||
res_x = 1000;
|
res_x = (72 / 2.54 * 100);
|
||||||
res_y = 1000;
|
res_y = (72 / 2.54 * 100);
|
||||||
png_get_pHYs( read->pPng, read->pInfo, &res_x, &res_y, &unit_type );
|
png_get_pHYs( read->pPng, read->pInfo, &res_x, &res_y, &unit_type );
|
||||||
switch( unit_type ) {
|
switch( unit_type ) {
|
||||||
case PNG_RESOLUTION_METER:
|
case PNG_RESOLUTION_METER:
|
||||||
|
Loading…
Reference in New Issue
Block a user