mirror of https://github.com/dsoprea/go-exif.git
ifd_enumerate.go: Bugfix for not skipping unknown tags
parent
74a1612f20
commit
089aa48c91
|
@ -247,7 +247,13 @@ func (ie *IfdEnumerate) parseTag(ii *exifcommon.IfdIdentity, tagPosition int, bp
|
||||||
// the registered tag. If not, skip processing the tag.
|
// the registered tag. If not, skip processing the tag.
|
||||||
|
|
||||||
it, err := ie.tagIndex.Get(ii, tagId)
|
it, err := ie.tagIndex.Get(ii, tagId)
|
||||||
log.PanicIf(err)
|
if err != nil {
|
||||||
|
if log.Is(err, ErrTagNotFound) == true {
|
||||||
|
ifdEnumerateLogger.Warningf(nil, "Tag (0x%04x) is not known and will be skipped.", tagId)
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
if it.DoesSupportType(tagType) == false {
|
if it.DoesSupportType(tagType) == false {
|
||||||
// The type in the stream disagrees with the type that this tag is
|
// The type in the stream disagrees with the type that this tag is
|
||||||
|
@ -427,8 +433,9 @@ func (ie *IfdEnumerate) parseIfd(ii *exifcommon.IfdIdentity, bp *byteParser, vis
|
||||||
for i := 0; i < int(tagCount); i++ {
|
for i := 0; i < int(tagCount); i++ {
|
||||||
ite, err := ie.parseTag(ii, i, bp)
|
ite, err := ie.parseTag(ii, i, bp)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err == ErrTagTypeNotValid {
|
if log.Is(err, ErrTagNotFound) == true || log.Is(err, ErrTagTypeNotValid) == true {
|
||||||
// This should've been fully logged in parseTag().
|
// These tags should've been fully logged in parseTag(). The
|
||||||
|
// ITE returned is nil so we can't print anything about them, now.
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue