ifd_tag_entry.go: Reimplement value/bytes using ValueContext

This is just a kludge until we can totally kill this type. Now fully
obsolete and no longer internally required.
pull/28/head
Dustin Oprea 2020-01-01 02:46:38 -05:00
parent 22222b24d0
commit fdb5de93d2
1 changed files with 21 additions and 5 deletions

View File

@ -199,10 +199,17 @@ func (itevr *IfdTagEntryValueResolver) ValueBytes(ite *IfdTagEntry) (value []byt
}
}()
// TODO(dustin): This method is not necessary in light of itevr.Value().
// OBSOLETE(dustin): This is now redundant. Use `(*ValueContext).readRawEncoded()` instead of this method.
value, err = ite.ValueBytes(itevr.addressableData, itevr.byteOrder)
return value, err
valueContext := newValueContextFromTag(
ite,
itevr.addressableData,
itevr.byteOrder)
rawBytes, err := valueContext.readRawEncoded()
log.PanicIf(err)
return rawBytes, nil
}
func (itevr *IfdTagEntryValueResolver) Value(ite *IfdTagEntry) (value interface{}, err error) {
@ -212,6 +219,15 @@ func (itevr *IfdTagEntryValueResolver) Value(ite *IfdTagEntry) (value interface{
}
}()
value, err = ite.Value(itevr.addressableData, itevr.byteOrder)
return value, err
// OBSOLETE(dustin): This is now redundant. Use `(*ValueContext).Values()` instead of this method.
valueContext := newValueContextFromTag(
ite,
itevr.addressableData,
itevr.byteOrder)
values, err := valueContext.Values()
log.PanicIf(err)
return values, nil
}