mirror of https://github.com/dsoprea/go-exif.git
ifd_enumerate.go: Allow GPS version to not exist
- Also, log when we're not processing GPS due to incompatible version.pull/18/head
parent
3f9a27433f
commit
4ff0938c41
|
@ -821,8 +821,11 @@ func (ifd *Ifd) GpsInfo() (gi *GpsInfo, err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if tags, found := ifd.EntriesByTagId[TagVersionId]; found == false {
|
if tags, found := ifd.EntriesByTagId[TagVersionId]; found == false {
|
||||||
log.Panic(ErrNoGpsTags)
|
// We've seen this. We'll just have to default to assuming we're in a
|
||||||
|
// 2.2.0.0 format.
|
||||||
|
ifdEnumerateLogger.Warningf(nil, "No GPS version tag (0x%04x) found.", TagVersionId)
|
||||||
} else if bytes.Compare(tags[0].value, []byte{2, 2, 0, 0}) != 0 {
|
} else if bytes.Compare(tags[0].value, []byte{2, 2, 0, 0}) != 0 {
|
||||||
|
ifdEnumerateLogger.Errorf(nil, nil, "GPS version not supported: %v", tags[0].value)
|
||||||
log.Panic(ErrNoGpsTags)
|
log.Panic(ErrNoGpsTags)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -834,6 +837,7 @@ func (ifd *Ifd) GpsInfo() (gi *GpsInfo, err error) {
|
||||||
latitudeValue, err := ifd.TagValue(tags[0])
|
latitudeValue, err := ifd.TagValue(tags[0])
|
||||||
log.PanicIf(err)
|
log.PanicIf(err)
|
||||||
|
|
||||||
|
// Look for whether North or South.
|
||||||
tags, found = ifd.EntriesByTagId[TagLatitudeRefId]
|
tags, found = ifd.EntriesByTagId[TagLatitudeRefId]
|
||||||
if found == false {
|
if found == false {
|
||||||
log.Panicf("latitude-ref not found")
|
log.Panicf("latitude-ref not found")
|
||||||
|
@ -850,6 +854,7 @@ func (ifd *Ifd) GpsInfo() (gi *GpsInfo, err error) {
|
||||||
longitudeValue, err := ifd.TagValue(tags[0])
|
longitudeValue, err := ifd.TagValue(tags[0])
|
||||||
log.PanicIf(err)
|
log.PanicIf(err)
|
||||||
|
|
||||||
|
// Look for whether West or East.
|
||||||
tags, found = ifd.EntriesByTagId[TagLongitudeRefId]
|
tags, found = ifd.EntriesByTagId[TagLongitudeRefId]
|
||||||
if found == false {
|
if found == false {
|
||||||
log.Panicf("longitude-ref not found")
|
log.Panicf("longitude-ref not found")
|
||||||
|
|
Loading…
Reference in New Issue