mirror of
https://github.com/dsoprea/go-exif.git
synced 2025-04-27 13:12:39 +00:00
ifd_builder.go: Fix (*IfdBuilder).printTagTree()
printing of child IFDs
This commit is contained in:
parent
a4b93837a7
commit
e5cdeb0aa4
@ -68,6 +68,8 @@ func (ibtv IfdBuilderTagValue) IsBytes() bool {
|
|||||||
func (ibtv IfdBuilderTagValue) Bytes() []byte {
|
func (ibtv IfdBuilderTagValue) Bytes() []byte {
|
||||||
if ibtv.IsBytes() == false {
|
if ibtv.IsBytes() == false {
|
||||||
log.Panicf("this tag is not a byte-slice value")
|
log.Panicf("this tag is not a byte-slice value")
|
||||||
|
} else if ibtv.IsIb() == true {
|
||||||
|
log.Panicf("this tag is an IFD-builder value not a byte-slice")
|
||||||
}
|
}
|
||||||
|
|
||||||
return ibtv.valueBytes
|
return ibtv.valueBytes
|
||||||
@ -80,6 +82,8 @@ func (ibtv IfdBuilderTagValue) IsIb() bool {
|
|||||||
func (ibtv IfdBuilderTagValue) Ib() *IfdBuilder {
|
func (ibtv IfdBuilderTagValue) Ib() *IfdBuilder {
|
||||||
if ibtv.IsIb() == false {
|
if ibtv.IsIb() == false {
|
||||||
log.Panicf("this tag is not an IFD-builder value")
|
log.Panicf("this tag is not an IFD-builder value")
|
||||||
|
} else if ibtv.IsBytes() == true {
|
||||||
|
log.Panicf("this tag is a byte-slice, not a IFD-builder")
|
||||||
}
|
}
|
||||||
|
|
||||||
return ibtv.ib
|
return ibtv.ib
|
||||||
@ -602,7 +606,13 @@ func (ib *IfdBuilder) printTagTree(levels int) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
value := tag.Value()
|
||||||
|
|
||||||
|
if value.IsIb() == true {
|
||||||
|
fmt.Printf("%s (%d): [%s] %s\n", indent, i, tagName, value.Ib())
|
||||||
|
} else {
|
||||||
fmt.Printf("%s (%d): [%s] %s\n", indent, i, tagName, tag)
|
fmt.Printf("%s (%d): [%s] %s\n", indent, i, tagName, tag)
|
||||||
|
}
|
||||||
|
|
||||||
if isChildIb == true {
|
if isChildIb == true {
|
||||||
if tag.value.IsIb() == false {
|
if tag.value.IsIb() == false {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user