mirror of https://github.com/dsoprea/go-exif.git
backwards incompatible: ifd_enumerate.go: Drop fqIfdPath and ifdIndex from visitor function signature
parent
f2c3d1c0ec
commit
d19e38a723
|
@ -67,7 +67,7 @@ func TestVisit(t *testing.T) {
|
|||
tags := make([]string, 0)
|
||||
|
||||
// DEPRECATED(dustin): fqIfdPath and ifdIndex are now redundant. Remove in next module version.
|
||||
visitor := func(fqIfdPath string, ifdIndex int, ite *IfdTagEntry) (err error) {
|
||||
visitor := func(ite *IfdTagEntry) (err error) {
|
||||
defer func() {
|
||||
if state := recover(); state != nil {
|
||||
err = log.Wrap(state.(error))
|
||||
|
|
|
@ -270,10 +270,8 @@ func (ie *IfdEnumerate) parseTag(ii *exifcommon.IfdIdentity, tagPosition int, bp
|
|||
return ite, nil
|
||||
}
|
||||
|
||||
// RELEASE(dustin): Drop fqIfdPath and ifdIndex arguments to visitor callback. They're both accessible on the IfdTagEntry struct.
|
||||
|
||||
// TagVisitorFn is called for each tag when enumerating through the EXIF.
|
||||
type TagVisitorFn func(fqIfdPath string, ifdIndex int, ite *IfdTagEntry) (err error)
|
||||
type TagVisitorFn func(ite *IfdTagEntry) (err error)
|
||||
|
||||
// tagPostParse do some tag-level processing here following the parse of each.
|
||||
func (ie *IfdEnumerate) tagPostParse(ite *IfdTagEntry, med *MiscellaneousExifData) (err error) {
|
||||
|
@ -422,7 +420,7 @@ func (ie *IfdEnumerate) parseIfd(ii *exifcommon.IfdIdentity, bp *byteParser, vis
|
|||
tagId := ite.TagId()
|
||||
|
||||
if visitor != nil {
|
||||
err := visitor(ii.String(), ii.Index(), ite)
|
||||
err := visitor(ite)
|
||||
log.PanicIf(err)
|
||||
}
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ func GetFlatExifData(exifData []byte, so *ScanOptions) (exifTags []ExifTag, med
|
|||
|
||||
exifTags = make([]ExifTag, 0)
|
||||
|
||||
visitor := func(fqIfdPath string, ifdIndex int, ite *IfdTagEntry) (err error) {
|
||||
visitor := func(ite *IfdTagEntry) (err error) {
|
||||
// This encodes down to base64. Since this an example tool and we do not
|
||||
// expect to ever decode the output, we are not worried about
|
||||
// specifically base64-encoding it in order to have a measure of
|
||||
|
@ -113,7 +113,7 @@ func GetFlatExifData(exifData []byte, so *ScanOptions) (exifTags []ExifTag, med
|
|||
}
|
||||
|
||||
et := ExifTag{
|
||||
IfdPath: fqIfdPath,
|
||||
IfdPath: ite.IfdPath(),
|
||||
TagId: ite.TagId(),
|
||||
TagName: ite.TagName(),
|
||||
UnitCount: ite.UnitCount(),
|
||||
|
|
Loading…
Reference in New Issue