From 439148e76714b52e4ed330fdb87652434006acf1 Mon Sep 17 00:00:00 2001 From: Dustin Oprea Date: Wed, 1 Jan 2020 02:57:34 -0500 Subject: [PATCH] Add commenting to unknown-type handling --- ifd_builder.go | 3 +++ tags_unknown.go | 1 + 2 files changed, 4 insertions(+) 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()