catch /0 in exif read
This commit is contained in:
parent
6c525e144b
commit
db6e6a0076
@ -237,14 +237,25 @@ vips_exif_get_double( ExifData *ed,
|
||||
{
|
||||
ExifRational rv;
|
||||
ExifSRational srv;
|
||||
double value;
|
||||
|
||||
if( !vips_exif_get_rational( ed, entry, component, &rv ) )
|
||||
*out = (double) rv.numerator / rv.denominator;
|
||||
else if( !vips_exif_get_srational( ed, entry, component, &srv ) )
|
||||
*out = (double) srv.numerator / srv.denominator;
|
||||
if( !vips_exif_get_rational( ed, entry, component, &rv ) ) {
|
||||
if( rv.denominator == 0 )
|
||||
value = 0;
|
||||
else
|
||||
value = (double) rv.numerator / rv.denominator;
|
||||
}
|
||||
else if( !vips_exif_get_srational( ed, entry, component, &srv ) ) {
|
||||
if( srv.denominator == 0 )
|
||||
value = 0;
|
||||
else
|
||||
value = (double) srv.numerator / srv.denominator;
|
||||
}
|
||||
else
|
||||
return( -1 );
|
||||
|
||||
*out = value;
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user