support exif res unit "none"
well why would you want that, but it seems some images use it
This commit is contained in:
parent
d085351f0f
commit
6269c852cc
@ -1,6 +1,7 @@
|
|||||||
8/9/14 started 7.40.8
|
8/9/14 started 7.40.8
|
||||||
- fix configure on rhel6 [Lovell]
|
- fix configure on rhel6 [Lovell]
|
||||||
- mono <-> rgb converters were not handling extra bands, thanks James
|
- mono <-> rgb converters were not handling extra bands, thanks James
|
||||||
|
- support jpeg resunit "none"
|
||||||
|
|
||||||
21/8/14 started 7.40.7
|
21/8/14 started 7.40.7
|
||||||
- width and height were swapped in matlab load
|
- width and height were swapped in matlab load
|
||||||
|
@ -57,6 +57,8 @@
|
|||||||
* - null-terminate exif strings, thanks Mike
|
* - null-terminate exif strings, thanks Mike
|
||||||
* 24/2/14
|
* 24/2/14
|
||||||
* - don't write to our input buffer, thanks Lovell
|
* - don't write to our input buffer, thanks Lovell
|
||||||
|
* 9/9/14
|
||||||
|
* - support "none" as a resolution unit
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -547,6 +549,13 @@ res_from_exif( VipsImage *im, ExifData *ed )
|
|||||||
#endif /*DEBUG*/
|
#endif /*DEBUG*/
|
||||||
|
|
||||||
switch( unit ) {
|
switch( unit ) {
|
||||||
|
case 1:
|
||||||
|
/* No unit ... just pass the fields straight to vips.
|
||||||
|
*/
|
||||||
|
vips_image_set_string( im,
|
||||||
|
VIPS_META_RESOLUTION_UNIT, "none" );
|
||||||
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
/* In inches.
|
/* In inches.
|
||||||
*/
|
*/
|
||||||
|
@ -63,6 +63,8 @@
|
|||||||
* - add "strip" option to remove all metadata
|
* - add "strip" option to remove all metadata
|
||||||
* 13/11/13
|
* 13/11/13
|
||||||
* - add a "no_subsample" option to disable chroma subsample
|
* - add a "no_subsample" option to disable chroma subsample
|
||||||
|
* 9/9/14
|
||||||
|
* - support "none" as a resolution unit
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -460,11 +462,19 @@ set_exif_resolution( ExifData *ed, VipsImage *im )
|
|||||||
*/
|
*/
|
||||||
unit = 2;
|
unit = 2;
|
||||||
if( vips_image_get_typeof( im, VIPS_META_RESOLUTION_UNIT ) &&
|
if( vips_image_get_typeof( im, VIPS_META_RESOLUTION_UNIT ) &&
|
||||||
!vips_image_get_string( im, VIPS_META_RESOLUTION_UNIT, &p ) &&
|
!vips_image_get_string( im, VIPS_META_RESOLUTION_UNIT, &p ) ) {
|
||||||
vips_isprefix( "cm", p ) )
|
if( vips_isprefix( "cm", p ) )
|
||||||
unit = 3;
|
unit = 3;
|
||||||
|
else if( vips_isprefix( "none", p ) )
|
||||||
|
unit = 1;
|
||||||
|
}
|
||||||
|
|
||||||
switch( unit ) {
|
switch( unit ) {
|
||||||
|
case 1:
|
||||||
|
xres = im->Xres;
|
||||||
|
yres = im->Yres;
|
||||||
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
xres = im->Xres * 25.4;
|
xres = im->Xres * 25.4;
|
||||||
yres = im->Yres * 25.4;
|
yres = im->Yres * 25.4;
|
||||||
|
Loading…
Reference in New Issue
Block a user