diff --git a/ifd_builder.go b/ifd_builder.go index 4854d6b..e28d67b 100644 --- a/ifd_builder.go +++ b/ifd_builder.go @@ -1126,6 +1126,9 @@ func (ib *IfdBuilder) AddTagsFromExisting(ifd *Ifd, itevr *IfdTagEntryValueResol _, isUnknownUndefined := x.(TagUnknownType_UnknownValue) if isUnknownUndefined == true { + // It's an undefined-type tag that we don't handle. If we + // don't know how to handle it, we can't know how many bytes + // it is and we must skip it. continue } diff --git a/tags_unknown.go b/tags_unknown.go index df53813..bf09ebe 100644 --- a/tags_unknown.go +++ b/tags_unknown.go @@ -390,6 +390,7 @@ func UndefinedValue(ifdPath string, tagId uint16, valueContext interface{}, byte // Return encapsulated data rather than an error so that we can at least // print/profile the opaque data. + // TODO(dustin): This won't ever work. The unit-count isn't necessarily correct. Revert to returning an error. valueContextPtr.SetUnknownValueType(TypeByte) valueBytes, err := valueContextPtr.ReadBytes()