mirror of https://github.com/dsoprea/go-exif.git
ifd_builder: Renamed "FromConfig" functions.
- ..to use the word "Standard" instead, instead of having both. - Removed original NewStandardBuilderTag function. Just used by a couple of tests and it conflicts with one of the renamings.pull/3/head
parent
92f24ca51b
commit
1c95c159fb
|
@ -104,20 +104,6 @@ func NewBuilderTag(ii IfdIdentity, tagId uint16, typeId uint16, value *IfdBuilde
|
|||
}
|
||||
}
|
||||
|
||||
func NewStandardBuilderTag(ii IfdIdentity, tagId uint16, value *IfdBuilderTagValue) *BuilderTag {
|
||||
ti := NewTagIndex()
|
||||
|
||||
it, err := ti.Get(ii, tagId)
|
||||
log.PanicIf(err)
|
||||
|
||||
return &BuilderTag{
|
||||
ii: ii,
|
||||
tagId: tagId,
|
||||
typeId: it.Type,
|
||||
value: value,
|
||||
}
|
||||
}
|
||||
|
||||
func NewChildIfdBuilderTag(ii IfdIdentity, tagId uint16, value *IfdBuilderTagValue) *BuilderTag {
|
||||
return &BuilderTag{
|
||||
ii: ii,
|
||||
|
@ -165,9 +151,9 @@ func (bt *BuilderTag) SetValue(byteOrder binary.ByteOrder, value interface{}) (e
|
|||
return nil
|
||||
}
|
||||
|
||||
// NewStandardBuilderTagFromConfig constructs a `BuilderTag` instance. The type
|
||||
// is looked up. `ii` is the type of IFD that owns this tag.
|
||||
func NewStandardBuilderTagFromConfig(ii IfdIdentity, tagId uint16, byteOrder binary.ByteOrder, value interface{}) *BuilderTag {
|
||||
// NewStandardBuilderTag constructs a `BuilderTag` instance. The type is looked
|
||||
// up. `ii` is the type of IFD that owns this tag.
|
||||
func NewStandardBuilderTag(ii IfdIdentity, tagId uint16, byteOrder binary.ByteOrder, value interface{}) *BuilderTag {
|
||||
ti := NewTagIndex()
|
||||
|
||||
it, err := ti.Get(ii, tagId)
|
||||
|
@ -200,39 +186,10 @@ func NewStandardBuilderTagFromConfig(ii IfdIdentity, tagId uint16, byteOrder bin
|
|||
tagValue)
|
||||
}
|
||||
|
||||
// NewStandardBuilderTagFromConfig constructs a `BuilderTag` instance. The type is
|
||||
// explicitly provided. `ii` is the type of IFD that owns this tag.
|
||||
func NewBuilderTagFromConfig(ii IfdIdentity, tagId uint16, typeId uint16, byteOrder binary.ByteOrder, value interface{}) *BuilderTag {
|
||||
tt := NewTagType(typeId, byteOrder)
|
||||
|
||||
ve := NewValueEncoder(byteOrder)
|
||||
|
||||
var ed EncodedData
|
||||
if typeId == TypeUndefined {
|
||||
var err error
|
||||
|
||||
ed, err = EncodeUndefined(ii, tagId, value)
|
||||
log.PanicIf(err)
|
||||
} else {
|
||||
var err error
|
||||
|
||||
ed, err = ve.EncodeWithType(tt, value)
|
||||
log.PanicIf(err)
|
||||
}
|
||||
|
||||
tagValue := NewIfdBuilderTagValueFromBytes(ed.Encoded)
|
||||
|
||||
return NewBuilderTag(
|
||||
ii,
|
||||
tagId,
|
||||
typeId,
|
||||
tagValue)
|
||||
}
|
||||
|
||||
// NewStandardBuilderTagFromConfigWithName allows us to easily generate solid, consistent tags
|
||||
// for testing with. `ii` is the type of IFD that owns this tag. This can not be
|
||||
// an IFD (IFDs are not associated with standardized, official names).
|
||||
func NewStandardBuilderTagFromConfigWithName(ii IfdIdentity, tagName string, byteOrder binary.ByteOrder, value interface{}) *BuilderTag {
|
||||
// NewStandardBuilderTagWithName allows us to easily generate solid, consistent
|
||||
// tags for testing with. `ii` is the type of IFD that owns this tag. This can
|
||||
// not be an IFD (IFDs are not associated with standardized, official names).
|
||||
func NewStandardBuilderTagWithName(ii IfdIdentity, tagName string, byteOrder binary.ByteOrder, value interface{}) *BuilderTag {
|
||||
ti := NewTagIndex()
|
||||
|
||||
it, err := ti.GetWithName(ii, tagName)
|
||||
|
@ -390,35 +347,25 @@ func (ib *IfdBuilder) SetThumbnail(data []byte) (err error) {
|
|||
log.Panicf("thumbnails can only go into a root Ifd (and only the second one)")
|
||||
}
|
||||
|
||||
// TODO(dustin): !! Add a test for this.
|
||||
// TODO(dustin): !! Add a test for this function.
|
||||
|
||||
if data == nil || len(data) == 0 {
|
||||
|
||||
// TODO(dustin): !! Debugging.
|
||||
// fmt.Printf("Thumbnail empty.\n")
|
||||
|
||||
log.Panic("thumbnail is empty")
|
||||
}
|
||||
|
||||
ib.thumbnailData = data
|
||||
|
||||
// fmt.Printf("SETTING THUMBNAIL.\n")
|
||||
|
||||
ibtvfb := NewIfdBuilderTagValueFromBytes(ib.thumbnailData)
|
||||
offsetBt := NewBuilderTag(ib.ii, ThumbnailOffsetTagId, TypeLong, ibtvfb)
|
||||
// offsetBt := NewStandardBuilderTagFromConfig(ib.ii, ThumbnailOffsetTagId, ib.byteOrder, []uint32 { 0 })
|
||||
|
||||
err = ib.Set(offsetBt)
|
||||
log.PanicIf(err)
|
||||
|
||||
sizeBt := NewStandardBuilderTagFromConfig(ib.ii, ThumbnailSizeTagId, ib.byteOrder, []uint32{uint32(len(ib.thumbnailData))})
|
||||
sizeBt := NewStandardBuilderTag(ib.ii, ThumbnailSizeTagId, ib.byteOrder, []uint32{uint32(len(ib.thumbnailData))})
|
||||
|
||||
err = ib.Set(sizeBt)
|
||||
log.PanicIf(err)
|
||||
|
||||
// TODO(dustin): !! Debugging.
|
||||
// fmt.Printf("Set thumbnail into IB.\n")
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -988,16 +935,16 @@ func (ib *IfdBuilder) AddTagsFromExisting(ifd *Ifd, itevr *IfdTagEntryValueResol
|
|||
return nil
|
||||
}
|
||||
|
||||
// AddFromConfig quickly and easily composes and adds the tag using the
|
||||
// AddStandard quickly and easily composes and adds the tag using the
|
||||
// information already known about a tag. Only works with standard tags.
|
||||
func (ib *IfdBuilder) AddFromConfig(tagId uint16, value interface{}) (err error) {
|
||||
func (ib *IfdBuilder) AddStandard(tagId uint16, value interface{}) (err error) {
|
||||
defer func() {
|
||||
if state := recover(); state != nil {
|
||||
err = log.Wrap(state.(error))
|
||||
}
|
||||
}()
|
||||
|
||||
bt := NewStandardBuilderTagFromConfig(ib.ii, tagId, ib.byteOrder, value)
|
||||
bt := NewStandardBuilderTag(ib.ii, tagId, ib.byteOrder, value)
|
||||
|
||||
err = ib.add(bt)
|
||||
log.PanicIf(err)
|
||||
|
@ -1005,18 +952,18 @@ func (ib *IfdBuilder) AddFromConfig(tagId uint16, value interface{}) (err error)
|
|||
return nil
|
||||
}
|
||||
|
||||
// SetFromConfig quickly and easily composes and adds or replaces the tag using
|
||||
// SetStandard quickly and easily composes and adds or replaces the tag using
|
||||
// the information already known about a tag. Only works with standard tags.
|
||||
func (ib *IfdBuilder) SetFromConfig(tagId uint16, value interface{}) (err error) {
|
||||
func (ib *IfdBuilder) SetStandard(tagId uint16, value interface{}) (err error) {
|
||||
defer func() {
|
||||
if state := recover(); state != nil {
|
||||
err = log.Wrap(state.(error))
|
||||
}
|
||||
}()
|
||||
|
||||
// TODO(dustin): !! Add test.
|
||||
// TODO(dustin): !! Add test for this function.
|
||||
|
||||
bt := NewStandardBuilderTagFromConfig(ib.ii, tagId, ib.byteOrder, value)
|
||||
bt := NewStandardBuilderTag(ib.ii, tagId, ib.byteOrder, value)
|
||||
|
||||
i, err := ib.Find(tagId)
|
||||
log.PanicIf(err)
|
||||
|
@ -1026,17 +973,17 @@ func (ib *IfdBuilder) SetFromConfig(tagId uint16, value interface{}) (err error)
|
|||
return nil
|
||||
}
|
||||
|
||||
// AddFromConfigWithName quickly and easily composes and adds the tag using the
|
||||
// AddStandardWithName quickly and easily composes and adds the tag using the
|
||||
// information already known about a tag (using the name). Only works with
|
||||
// standard tags.
|
||||
func (ib *IfdBuilder) AddFromConfigWithName(tagName string, value interface{}) (err error) {
|
||||
func (ib *IfdBuilder) AddStandardWithName(tagName string, value interface{}) (err error) {
|
||||
defer func() {
|
||||
if state := recover(); state != nil {
|
||||
err = log.Wrap(state.(error))
|
||||
}
|
||||
}()
|
||||
|
||||
bt := NewStandardBuilderTagFromConfigWithName(ib.ii, tagName, ib.byteOrder, value)
|
||||
bt := NewStandardBuilderTagWithName(ib.ii, tagName, ib.byteOrder, value)
|
||||
|
||||
err = ib.add(bt)
|
||||
log.PanicIf(err)
|
||||
|
@ -1044,19 +991,19 @@ func (ib *IfdBuilder) AddFromConfigWithName(tagName string, value interface{}) (
|
|||
return nil
|
||||
}
|
||||
|
||||
// SetFromConfigWithName quickly and easily composes and adds or replaces the
|
||||
// SetStandardWithName quickly and easily composes and adds or replaces the
|
||||
// tag using the information already known about a tag (using the name). Only
|
||||
// works with standard tags.
|
||||
func (ib *IfdBuilder) SetFromConfigWithName(tagName string, value interface{}) (err error) {
|
||||
func (ib *IfdBuilder) SetStandardWithName(tagName string, value interface{}) (err error) {
|
||||
defer func() {
|
||||
if state := recover(); state != nil {
|
||||
err = log.Wrap(state.(error))
|
||||
}
|
||||
}()
|
||||
|
||||
// TODO(dustin): !! Add test.
|
||||
// TODO(dustin): !! Add test for this function.
|
||||
|
||||
bt := NewStandardBuilderTagFromConfigWithName(ib.ii, tagName, ib.byteOrder, value)
|
||||
bt := NewStandardBuilderTagWithName(ib.ii, tagName, ib.byteOrder, value)
|
||||
|
||||
i, err := ib.Find(bt.tagId)
|
||||
log.PanicIf(err)
|
||||
|
|
|
@ -192,7 +192,7 @@ func Test_IfdByteEncoder_encodeTagToBytes_bytes_embedded1(t *testing.T) {
|
|||
|
||||
ib := NewIfdBuilder(GpsIi, TestDefaultByteOrder)
|
||||
|
||||
bt := NewStandardBuilderTagFromConfig(GpsIi, uint16(0x0000), TestDefaultByteOrder, []uint8 { uint8(0x12) })
|
||||
bt := NewStandardBuilderTag(GpsIi, uint16(0x0000), TestDefaultByteOrder, []uint8 { uint8(0x12) })
|
||||
|
||||
b := new(bytes.Buffer)
|
||||
bw := NewByteWriter(b, TestDefaultByteOrder)
|
||||
|
@ -217,7 +217,7 @@ func Test_IfdByteEncoder_encodeTagToBytes_bytes_embedded2(t *testing.T) {
|
|||
|
||||
ib := NewIfdBuilder(GpsIi, TestDefaultByteOrder)
|
||||
|
||||
bt := NewStandardBuilderTagFromConfig(GpsIi, uint16(0x0000), TestDefaultByteOrder, []uint8 { uint8(0x12), uint8(0x34), uint8(0x56), uint8(0x78) })
|
||||
bt := NewStandardBuilderTag(GpsIi, uint16(0x0000), TestDefaultByteOrder, []uint8 { uint8(0x12), uint8(0x34), uint8(0x56), uint8(0x78) })
|
||||
|
||||
b := new(bytes.Buffer)
|
||||
bw := NewByteWriter(b, TestDefaultByteOrder)
|
||||
|
@ -248,7 +248,7 @@ func Test_IfdByteEncoder_encodeTagToBytes_bytes_allocated(t *testing.T) {
|
|||
addressableOffset := uint32(0x1234)
|
||||
ida := newIfdDataAllocator(addressableOffset)
|
||||
|
||||
bt := NewStandardBuilderTagFromConfig(GpsIi, uint16(0x0000), TestDefaultByteOrder, []uint8 { uint8(0x12), uint8(0x34), uint8(0x56), uint8(0x78), uint8(0x9a) })
|
||||
bt := NewStandardBuilderTag(GpsIi, uint16(0x0000), TestDefaultByteOrder, []uint8 { uint8(0x12), uint8(0x34), uint8(0x56), uint8(0x78), uint8(0x9a) })
|
||||
|
||||
childIfdBlock, err := ibe.encodeTagToBytes(ib, bt, bw, ida, uint32(0))
|
||||
log.PanicIf(err)
|
||||
|
@ -265,7 +265,7 @@ func Test_IfdByteEncoder_encodeTagToBytes_bytes_allocated(t *testing.T) {
|
|||
|
||||
// Test that another allocation encodes to the new offset.
|
||||
|
||||
bt = NewStandardBuilderTagFromConfig(GpsIi, uint16(0x0000), TestDefaultByteOrder, []uint8 { uint8(0xbc), uint8(0xde), uint8(0xf0), uint8(0x12), uint8(0x34) })
|
||||
bt = NewStandardBuilderTag(GpsIi, uint16(0x0000), TestDefaultByteOrder, []uint8 { uint8(0xbc), uint8(0xde), uint8(0xf0), uint8(0x12), uint8(0x34) })
|
||||
|
||||
childIfdBlock, err = ibe.encodeTagToBytes(ib, bt, bw, ida, uint32(0))
|
||||
log.PanicIf(err)
|
||||
|
@ -322,10 +322,12 @@ func Test_IfdByteEncoder_encodeTagToBytes_childIfd__withAllocate(t *testing.T) {
|
|||
|
||||
childIb := NewIfdBuilder(ExifIi, TestDefaultByteOrder)
|
||||
|
||||
childIbTestTag := NewStandardBuilderTag(
|
||||
ExifIi,
|
||||
0x8822,
|
||||
NewIfdBuilderTagValueFromBytes([]byte { 0x12, 0x34 }))
|
||||
childIbTestTag := &BuilderTag{
|
||||
ii: ExifIi,
|
||||
tagId: 0x8822,
|
||||
typeId: TypeShort,
|
||||
value: NewIfdBuilderTagValueFromBytes([]byte { 0x12, 0x34 }),
|
||||
}
|
||||
|
||||
childIb.Add(childIbTestTag)
|
||||
|
||||
|
@ -437,7 +439,7 @@ func Test_IfdByteEncoder_encodeTagToBytes_simpleTag_allocate(t *testing.T) {
|
|||
ib := NewIfdBuilder(RootIi, TestDefaultByteOrder)
|
||||
|
||||
valueString := "testvalue"
|
||||
bt := NewStandardBuilderTagFromConfig(RootIi, uint16(0x000b), TestDefaultByteOrder, valueString)
|
||||
bt := NewStandardBuilderTag(RootIi, uint16(0x000b), TestDefaultByteOrder, valueString)
|
||||
|
||||
b := new(bytes.Buffer)
|
||||
bw := NewByteWriter(b, TestDefaultByteOrder)
|
||||
|
@ -500,16 +502,16 @@ func Test_IfdByteEncoder_encodeTagToBytes_simpleTag_allocate(t *testing.T) {
|
|||
func getExifSimpleTestIb() *IfdBuilder {
|
||||
ib := NewIfdBuilder(RootIi, TestDefaultByteOrder)
|
||||
|
||||
err := ib.AddFromConfig(0x000b, "asciivalue")
|
||||
err := ib.AddStandard(0x000b, "asciivalue")
|
||||
log.PanicIf(err)
|
||||
|
||||
err = ib.AddFromConfig(0x00ff, []uint16 { 0x1122 })
|
||||
err = ib.AddStandard(0x00ff, []uint16 { 0x1122 })
|
||||
log.PanicIf(err)
|
||||
|
||||
err = ib.AddFromConfig(0x0100, []uint32 { 0x33445566 })
|
||||
err = ib.AddStandard(0x0100, []uint32 { 0x33445566 })
|
||||
log.PanicIf(err)
|
||||
|
||||
err = ib.AddFromConfig(0x013e, []Rational { { Numerator: 0x11112222, Denominator: 0x33334444 } })
|
||||
err = ib.AddStandard(0x013e, []Rational { { Numerator: 0x11112222, Denominator: 0x33334444 } })
|
||||
log.PanicIf(err)
|
||||
|
||||
return ib
|
||||
|
@ -751,10 +753,10 @@ func Test_IfdByteEncoder_EncodeToExif_WithChildAndSibling(t *testing.T) {
|
|||
|
||||
ib := NewIfdBuilder(RootIi, TestDefaultByteOrder)
|
||||
|
||||
err := ib.AddFromConfig(0x000b, "asciivalue")
|
||||
err := ib.AddStandard(0x000b, "asciivalue")
|
||||
log.PanicIf(err)
|
||||
|
||||
err = ib.AddFromConfig(0x00ff, []uint16 { 0x1122 })
|
||||
err = ib.AddStandard(0x00ff, []uint16 { 0x1122 })
|
||||
log.PanicIf(err)
|
||||
|
||||
|
||||
|
@ -762,17 +764,17 @@ func Test_IfdByteEncoder_EncodeToExif_WithChildAndSibling(t *testing.T) {
|
|||
|
||||
childIb := NewIfdBuilder(ExifIi, TestDefaultByteOrder)
|
||||
|
||||
err = childIb.AddFromConfigWithName("ISOSpeedRatings", []uint16 { 0x1122 })
|
||||
err = childIb.AddStandardWithName("ISOSpeedRatings", []uint16 { 0x1122 })
|
||||
log.PanicIf(err)
|
||||
|
||||
err = childIb.AddFromConfigWithName("ISOSpeed", []uint32 { 0x33445566 })
|
||||
err = childIb.AddStandardWithName("ISOSpeed", []uint32 { 0x33445566 })
|
||||
log.PanicIf(err)
|
||||
|
||||
err = ib.AddChildIb(childIb)
|
||||
log.PanicIf(err)
|
||||
|
||||
|
||||
err = ib.AddFromConfig(0x0100, []uint32 { 0x33445566 })
|
||||
err = ib.AddStandard(0x0100, []uint32 { 0x33445566 })
|
||||
log.PanicIf(err)
|
||||
|
||||
|
||||
|
@ -781,14 +783,14 @@ func Test_IfdByteEncoder_EncodeToExif_WithChildAndSibling(t *testing.T) {
|
|||
|
||||
childIb2 := NewIfdBuilder(GpsIi, TestDefaultByteOrder)
|
||||
|
||||
err = childIb2.AddFromConfigWithName("GPSAltitudeRef", []uint8 { 0x11, 0x22 })
|
||||
err = childIb2.AddStandardWithName("GPSAltitudeRef", []uint8 { 0x11, 0x22 })
|
||||
log.PanicIf(err)
|
||||
|
||||
err = ib.AddChildIb(childIb2)
|
||||
log.PanicIf(err)
|
||||
|
||||
|
||||
err = ib.AddFromConfig(0x013e, []Rational { { Numerator: 0x11112222, Denominator: 0x33334444 } })
|
||||
err = ib.AddStandard(0x013e, []Rational { { Numerator: 0x11112222, Denominator: 0x33334444 } })
|
||||
log.PanicIf(err)
|
||||
|
||||
|
||||
|
@ -797,10 +799,10 @@ func Test_IfdByteEncoder_EncodeToExif_WithChildAndSibling(t *testing.T) {
|
|||
|
||||
nextIb := NewIfdBuilder(RootIi, TestDefaultByteOrder)
|
||||
|
||||
err = nextIb.AddFromConfig(0x0101, []uint32 { 0x11223344 })
|
||||
err = nextIb.AddStandard(0x0101, []uint32 { 0x11223344 })
|
||||
log.PanicIf(err)
|
||||
|
||||
err = nextIb.AddFromConfig(0x0102, []uint16 { 0x5566 })
|
||||
err = nextIb.AddStandard(0x0102, []uint16 { 0x5566 })
|
||||
log.PanicIf(err)
|
||||
|
||||
ib.SetNextIb(nextIb)
|
||||
|
@ -867,22 +869,22 @@ func ExampleIfdByteEncoder_EncodeToExif() {
|
|||
|
||||
ib := NewIfdBuilder(RootIi, TestDefaultByteOrder)
|
||||
|
||||
err := ib.AddFromConfigWithName("ProcessingSoftware", "asciivalue")
|
||||
err := ib.AddStandardWithName("ProcessingSoftware", "asciivalue")
|
||||
log.PanicIf(err)
|
||||
|
||||
err = ib.AddFromConfigWithName("DotRange", []uint8 { 0x11 })
|
||||
err = ib.AddStandardWithName("DotRange", []uint8 { 0x11 })
|
||||
log.PanicIf(err)
|
||||
|
||||
err = ib.AddFromConfigWithName("SubfileType", []uint16 { 0x2233 })
|
||||
err = ib.AddStandardWithName("SubfileType", []uint16 { 0x2233 })
|
||||
log.PanicIf(err)
|
||||
|
||||
err = ib.AddFromConfigWithName("ImageWidth", []uint32 { 0x44556677 })
|
||||
err = ib.AddStandardWithName("ImageWidth", []uint32 { 0x44556677 })
|
||||
log.PanicIf(err)
|
||||
|
||||
err = ib.AddFromConfigWithName("WhitePoint", []Rational { { Numerator: 0x11112222, Denominator: 0x33334444 } })
|
||||
err = ib.AddStandardWithName("WhitePoint", []Rational { { Numerator: 0x11112222, Denominator: 0x33334444 } })
|
||||
log.PanicIf(err)
|
||||
|
||||
err = ib.AddFromConfigWithName("ShutterSpeedValue", []SignedRational { { Numerator: 0x11112222, Denominator: 0x33334444 } })
|
||||
err = ib.AddStandardWithName("ShutterSpeedValue", []SignedRational { { Numerator: 0x11112222, Denominator: 0x33334444 } })
|
||||
log.PanicIf(err)
|
||||
|
||||
|
||||
|
|
|
@ -1627,8 +1627,8 @@ func Test_IfdBuilder_CreateIfdBuilderWithExistingIfd(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestNewStandardBuilderTagFromConfig_OneUnit(t *testing.T) {
|
||||
bt := NewStandardBuilderTagFromConfig(ExifIi, uint16(0x8833), TestDefaultByteOrder, []uint32{uint32(0x1234)})
|
||||
func TestNewStandardBuilderTag_OneUnit(t *testing.T) {
|
||||
bt := NewStandardBuilderTag(ExifIi, uint16(0x8833), TestDefaultByteOrder, []uint32{uint32(0x1234)})
|
||||
|
||||
if bt.ii != ExifIi {
|
||||
t.Fatalf("II in BuilderTag not correct")
|
||||
|
@ -1639,8 +1639,8 @@ func TestNewStandardBuilderTagFromConfig_OneUnit(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestNewStandardBuilderTagFromConfig_TwoUnits(t *testing.T) {
|
||||
bt := NewStandardBuilderTagFromConfig(ExifIi, uint16(0x8833), TestDefaultByteOrder, []uint32{uint32(0x1234), uint32(0x5678)})
|
||||
func TestNewStandardBuilderTag_TwoUnits(t *testing.T) {
|
||||
bt := NewStandardBuilderTag(ExifIi, uint16(0x8833), TestDefaultByteOrder, []uint32{uint32(0x1234), uint32(0x5678)})
|
||||
|
||||
if bt.ii != ExifIi {
|
||||
t.Fatalf("II in BuilderTag not correct")
|
||||
|
@ -1653,8 +1653,8 @@ func TestNewStandardBuilderTagFromConfig_TwoUnits(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestNewStandardBuilderTagFromConfigWithName(t *testing.T) {
|
||||
bt := NewStandardBuilderTagFromConfigWithName(ExifIi, "ISOSpeed", TestDefaultByteOrder, []uint32{uint32(0x1234), uint32(0x5678)})
|
||||
func TestNewStandardBuilderTagWithName(t *testing.T) {
|
||||
bt := NewStandardBuilderTagWithName(ExifIi, "ISOSpeed", TestDefaultByteOrder, []uint32{uint32(0x1234), uint32(0x5678)})
|
||||
|
||||
if bt.ii != ExifIi {
|
||||
t.Fatalf("II in BuilderTag not correct")
|
||||
|
@ -1667,10 +1667,10 @@ func TestNewStandardBuilderTagFromConfigWithName(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestAddFromConfigWithName(t *testing.T) {
|
||||
func TestAddStandardWithName(t *testing.T) {
|
||||
ib := NewIfdBuilder(RootIi, TestDefaultByteOrder)
|
||||
|
||||
err := ib.AddFromConfigWithName("ProcessingSoftware", "some software")
|
||||
err := ib.AddStandardWithName("ProcessingSoftware", "some software")
|
||||
log.PanicIf(err)
|
||||
|
||||
if len(ib.tags) != 1 {
|
||||
|
|
|
@ -28,7 +28,13 @@ func TestUndefinedValue_ExifVersion(t *testing.T) {
|
|||
// have the bytes.
|
||||
|
||||
encodedValue := NewIfdBuilderTagValueFromBytes(ed.Encoded)
|
||||
bt := NewStandardBuilderTag(ii, 0x9000, encodedValue)
|
||||
|
||||
bt := &BuilderTag{
|
||||
ii: ii,
|
||||
tagId: 0x9000,
|
||||
typeId: TypeUndefined,
|
||||
value: encodedValue,
|
||||
}
|
||||
|
||||
|
||||
// Stage the build.
|
||||
|
|
Loading…
Reference in New Issue