mirror of https://github.com/dsoprea/go-exif.git
utility.go: Bugfix for non-FQ IFD-paths in GetFlatExifData
parent
42546383ce
commit
70b6dc8a1a
|
@ -283,7 +283,7 @@ func (ie *IfdEnumerate) ParseIfd(fqIfdPath string, ifdIndex int, bp *byteParser,
|
|||
tagCount, _, err := bp.getUint16()
|
||||
log.PanicIf(err)
|
||||
|
||||
ifdEnumerateLogger.Debugf(nil, "Current IFD tag-count: (%d)", tagCount)
|
||||
ifdEnumerateLogger.Debugf(nil, "IFD [%s] tag-count: (%d)", fqIfdPath, tagCount)
|
||||
|
||||
entries = make([]*IfdTagEntry, 0)
|
||||
|
||||
|
@ -402,20 +402,20 @@ func (ie *IfdEnumerate) scan(ifdName string, ifdOffset uint32, visitor TagVisito
|
|||
// TODO(dustin): Add test
|
||||
|
||||
for ifdIndex := 0; ; ifdIndex++ {
|
||||
ifdEnumerateLogger.Debugf(nil, "Parsing IFD [%s] (%d) at offset (0x%04x) (scan).", ifdName, ifdIndex, ifdOffset)
|
||||
fqIfdPath := FqIfdPath("", ifdName, ifdIndex)
|
||||
|
||||
ifdEnumerateLogger.Debugf(nil, "Parsing IFD [%s] at offset (0x%04x) (scan).", fqIfdPath, ifdOffset)
|
||||
|
||||
bp, err := ie.getByteParser(ifdOffset)
|
||||
if err != nil {
|
||||
if err == ErrOffsetInvalid {
|
||||
ifdEnumerateLogger.Errorf(nil, nil, "IFD [%s] (%d) at offset (0x%04x) is unreachable. Terminating scan.", ifdName, ifdIndex, ifdOffset)
|
||||
ifdEnumerateLogger.Errorf(nil, nil, "IFD [%s] at offset (0x%04x) is unreachable. Terminating scan.", fqIfdPath, ifdOffset)
|
||||
break
|
||||
}
|
||||
|
||||
log.Panic(err)
|
||||
}
|
||||
|
||||
fqIfdPath := FqIfdPath("", ifdName, ifdIndex)
|
||||
|
||||
nextIfdOffset, _, _, err := ie.ParseIfd(fqIfdPath, ifdIndex, bp, visitor, true)
|
||||
log.PanicIf(err)
|
||||
|
||||
|
|
|
@ -148,7 +148,7 @@ func GetFlatExifData(exifData []byte) (exifTags []ExifTag, err error) {
|
|||
tagType := ite.TagType()
|
||||
|
||||
et := ExifTag{
|
||||
IfdPath: ifd.IfdPath,
|
||||
IfdPath: ifd.FqIfdPath,
|
||||
TagId: ite.TagId(),
|
||||
TagName: tagName,
|
||||
TagTypeId: tagType,
|
||||
|
|
Loading…
Reference in New Issue