mirror of
https://github.com/dsoprea/go-exif.git
synced 2025-04-27 21:22:59 +00:00
Minor tweaks/renamings
This commit is contained in:
parent
78e9e28053
commit
22222b24d0
@ -7,7 +7,7 @@ import (
|
|||||||
"github.com/dsoprea/go-logging"
|
"github.com/dsoprea/go-logging"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Test_IfdTagEntry_ValueString_Allocated(t *testing.T) {
|
func TestIfdTagEntry_ValueString_Allocated(t *testing.T) {
|
||||||
ite := IfdTagEntry{
|
ite := IfdTagEntry{
|
||||||
TagId: 0x1,
|
TagId: 0x1,
|
||||||
TagIndex: 0,
|
TagIndex: 0,
|
||||||
@ -29,7 +29,7 @@ func Test_IfdTagEntry_ValueString_Allocated(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_IfdTagEntry_ValueString_Embedded(t *testing.T) {
|
func TestIfdTagEntry_ValueString_Embedded(t *testing.T) {
|
||||||
data := []byte{0x11, 0x22, 0x33, 0x44}
|
data := []byte{0x11, 0x22, 0x33, 0x44}
|
||||||
|
|
||||||
ite := IfdTagEntry{
|
ite := IfdTagEntry{
|
||||||
@ -51,7 +51,7 @@ func Test_IfdTagEntry_ValueString_Embedded(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_IfdTagEntry_ValueString_Unknown(t *testing.T) {
|
func TestIfdTagEntry_ValueString_Unknown(t *testing.T) {
|
||||||
data := []uint8{'0', '2', '3', '0'}
|
data := []uint8{'0', '2', '3', '0'}
|
||||||
|
|
||||||
ite := IfdTagEntry{
|
ite := IfdTagEntry{
|
||||||
@ -73,7 +73,7 @@ func Test_IfdTagEntry_ValueString_Unknown(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_IfdTagEntry_ValueBytes_Allocated(t *testing.T) {
|
func TestIfdTagEntry_ValueBytes_Allocated(t *testing.T) {
|
||||||
ite := IfdTagEntry{
|
ite := IfdTagEntry{
|
||||||
TagId: 0x1,
|
TagId: 0x1,
|
||||||
TagIndex: 0,
|
TagIndex: 0,
|
||||||
@ -94,7 +94,7 @@ func Test_IfdTagEntry_ValueBytes_Allocated(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_IfdTagEntry_ValueBytes_Embedded(t *testing.T) {
|
func TestIfdTagEntry_ValueBytes_Embedded(t *testing.T) {
|
||||||
data := []byte{0x11, 0x22, 0x33, 0x44}
|
data := []byte{0x11, 0x22, 0x33, 0x44}
|
||||||
|
|
||||||
ite := IfdTagEntry{
|
ite := IfdTagEntry{
|
||||||
@ -115,7 +115,7 @@ func Test_IfdTagEntry_ValueBytes_Embedded(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_IfdTagEntry_Value_Normal(t *testing.T) {
|
func TestIfdTagEntry_Value_Normal(t *testing.T) {
|
||||||
data := []byte{0x11, 0x22, 0x33, 0x44}
|
data := []byte{0x11, 0x22, 0x33, 0x44}
|
||||||
|
|
||||||
ite := IfdTagEntry{
|
ite := IfdTagEntry{
|
||||||
@ -136,7 +136,7 @@ func Test_IfdTagEntry_Value_Normal(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_IfdTagEntry_Value_Unknown(t *testing.T) {
|
func TestIfdTagEntry_Value_Unknown(t *testing.T) {
|
||||||
data := []uint8{'0', '2', '3', '0'}
|
data := []uint8{'0', '2', '3', '0'}
|
||||||
|
|
||||||
ite := IfdTagEntry{
|
ite := IfdTagEntry{
|
||||||
@ -162,7 +162,7 @@ func Test_IfdTagEntry_Value_Unknown(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_IfdTagEntry_String(t *testing.T) {
|
func TestIfdTagEntry_String(t *testing.T) {
|
||||||
ite := IfdTagEntry{
|
ite := IfdTagEntry{
|
||||||
TagId: 0x1,
|
TagId: 0x1,
|
||||||
TagIndex: 0,
|
TagIndex: 0,
|
||||||
@ -179,7 +179,7 @@ func Test_IfdTagEntry_String(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_IfdTagEntryValueResolver_ValueBytes(t *testing.T) {
|
func TestIfdTagEntryValueResolver_ValueBytes(t *testing.T) {
|
||||||
allocatedData := []byte{0x11, 0x22, 0x33, 0x44, 0x55, 0x66}
|
allocatedData := []byte{0x11, 0x22, 0x33, 0x44, 0x55, 0x66}
|
||||||
|
|
||||||
ite := IfdTagEntry{
|
ite := IfdTagEntry{
|
||||||
|
@ -295,7 +295,7 @@ func (vc *ValueContext) ReadSignedRationals() (value []SignedRational, err error
|
|||||||
// Since this method lacks the information to process unknown-type tags (e.g.
|
// Since this method lacks the information to process unknown-type tags (e.g.
|
||||||
// byte-order, tag-ID, IFD type), it will return an error if attempted. See
|
// byte-order, tag-ID, IFD type), it will return an error if attempted. See
|
||||||
// `Undefined()`.
|
// `Undefined()`.
|
||||||
func (vc *ValueContext) Values() (value interface{}, err error) {
|
func (vc *ValueContext) Values() (values interface{}, err error) {
|
||||||
defer func() {
|
defer func() {
|
||||||
if state := recover(); state != nil {
|
if state := recover(); state != nil {
|
||||||
err = log.Wrap(state.(error))
|
err = log.Wrap(state.(error))
|
||||||
@ -303,28 +303,28 @@ func (vc *ValueContext) Values() (value interface{}, err error) {
|
|||||||
}()
|
}()
|
||||||
|
|
||||||
if vc.tagType == TypeByte {
|
if vc.tagType == TypeByte {
|
||||||
value, err = vc.ReadBytes()
|
values, err = vc.ReadBytes()
|
||||||
log.PanicIf(err)
|
log.PanicIf(err)
|
||||||
} else if vc.tagType == TypeAscii {
|
} else if vc.tagType == TypeAscii {
|
||||||
value, err = vc.ReadAscii()
|
values, err = vc.ReadAscii()
|
||||||
log.PanicIf(err)
|
log.PanicIf(err)
|
||||||
} else if vc.tagType == TypeAsciiNoNul {
|
} else if vc.tagType == TypeAsciiNoNul {
|
||||||
value, err = vc.ReadAsciiNoNul()
|
values, err = vc.ReadAsciiNoNul()
|
||||||
log.PanicIf(err)
|
log.PanicIf(err)
|
||||||
} else if vc.tagType == TypeShort {
|
} else if vc.tagType == TypeShort {
|
||||||
value, err = vc.ReadShorts()
|
values, err = vc.ReadShorts()
|
||||||
log.PanicIf(err)
|
log.PanicIf(err)
|
||||||
} else if vc.tagType == TypeLong {
|
} else if vc.tagType == TypeLong {
|
||||||
value, err = vc.ReadLongs()
|
values, err = vc.ReadLongs()
|
||||||
log.PanicIf(err)
|
log.PanicIf(err)
|
||||||
} else if vc.tagType == TypeRational {
|
} else if vc.tagType == TypeRational {
|
||||||
value, err = vc.ReadRationals()
|
values, err = vc.ReadRationals()
|
||||||
log.PanicIf(err)
|
log.PanicIf(err)
|
||||||
} else if vc.tagType == TypeSignedLong {
|
} else if vc.tagType == TypeSignedLong {
|
||||||
value, err = vc.ReadSignedLongs()
|
values, err = vc.ReadSignedLongs()
|
||||||
log.PanicIf(err)
|
log.PanicIf(err)
|
||||||
} else if vc.tagType == TypeSignedRational {
|
} else if vc.tagType == TypeSignedRational {
|
||||||
value, err = vc.ReadSignedRationals()
|
values, err = vc.ReadSignedRationals()
|
||||||
log.PanicIf(err)
|
log.PanicIf(err)
|
||||||
} else if vc.tagType == TypeUndefined {
|
} else if vc.tagType == TypeUndefined {
|
||||||
log.Panicf("will not parse undefined-type value")
|
log.Panicf("will not parse undefined-type value")
|
||||||
@ -338,7 +338,7 @@ func (vc *ValueContext) Values() (value interface{}, err error) {
|
|||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return value, nil
|
return values, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Undefined attempts to identify and decode supported undefined-type fields.
|
// Undefined attempts to identify and decode supported undefined-type fields.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user