mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-24 03:35:53 +01:00
Do not require GPSAltitudeRef (assume positive if missing)
This commit is contained in:
parent
541e658741
commit
51c88e7c7c
@ -54,8 +54,7 @@ QDate EXIFParser::date(TIFFFile &file, const IFDEntry &ds) const
|
||||
double EXIFParser::altitude(TIFFFile &file, const IFDEntry &alt,
|
||||
const IFDEntry &altRef) const
|
||||
{
|
||||
if (!(alt.type == TIFF_RATIONAL && alt.count == 1
|
||||
&& altRef.type == TIFF_BYTE && altRef.count == 1))
|
||||
if (!(alt.type == TIFF_RATIONAL && alt.count == 1))
|
||||
return NAN;
|
||||
|
||||
if (!file.seek(alt.offset))
|
||||
@ -67,7 +66,8 @@ double EXIFParser::altitude(TIFFFile &file, const IFDEntry &alt,
|
||||
if (!file.readValue(den))
|
||||
return NAN;
|
||||
|
||||
return altRef.offset ? -num/(double)den : num/(double)den;
|
||||
return (altRef.type == TIFF_BYTE && altRef.count == 1 && altRef.offset)
|
||||
? -num/(double)den : num/(double)den;
|
||||
}
|
||||
|
||||
double EXIFParser::coordinate(TIFFFile &file, const IFDEntry &ll) const
|
||||
|
Loading…
Reference in New Issue
Block a user