Add commenting to unknown-type handling

This commit is contained in:
Dustin Oprea 2020-01-01 02:57:34 -05:00
parent fdb5de93d2
commit 439148e767
2 changed files with 4 additions and 0 deletions

View File

@ -1126,6 +1126,9 @@ func (ib *IfdBuilder) AddTagsFromExisting(ifd *Ifd, itevr *IfdTagEntryValueResol
_, isUnknownUndefined := x.(TagUnknownType_UnknownValue) _, isUnknownUndefined := x.(TagUnknownType_UnknownValue)
if isUnknownUndefined == true { 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 continue
} }

View File

@ -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 // Return encapsulated data rather than an error so that we can at least
// print/profile the opaque data. // 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) valueContextPtr.SetUnknownValueType(TypeByte)
valueBytes, err := valueContextPtr.ReadBytes() valueBytes, err := valueContextPtr.ReadBytes()