mirror of https://github.com/dsoprea/go-exif.git
Fix for type-embedded strings not being encoded to JSON correctly in earlier Go's
parent
3b18b2295e
commit
25524615d1
|
@ -248,7 +248,9 @@
|
|||
"tag_type_id": 7,
|
||||
"tag_type_name": "UNDEFINED",
|
||||
"unit_count": 4,
|
||||
"value": {},
|
||||
"value": {
|
||||
"ExifVersion": "0230"
|
||||
},
|
||||
"value_string": "0230"
|
||||
},
|
||||
{
|
||||
|
@ -461,7 +463,9 @@
|
|||
"tag_type_id": 7,
|
||||
"tag_type_name": "UNDEFINED",
|
||||
"unit_count": 4,
|
||||
"value": {},
|
||||
"value": {
|
||||
"FlashpixVersion": "0100"
|
||||
},
|
||||
"value_string": "0100"
|
||||
},
|
||||
{
|
||||
|
@ -541,7 +545,9 @@
|
|||
"tag_type_id": 7,
|
||||
"tag_type_name": "UNDEFINED",
|
||||
"unit_count": 4,
|
||||
"value": {},
|
||||
"value": {
|
||||
"InteropVersion": "0100"
|
||||
},
|
||||
"value_string": "0100"
|
||||
},
|
||||
{
|
||||
|
|
|
@ -9,7 +9,7 @@ import (
|
|||
)
|
||||
|
||||
type Tag9000ExifVersion struct {
|
||||
string
|
||||
ExifVersion string
|
||||
}
|
||||
|
||||
func (Tag9000ExifVersion) EncoderName() string {
|
||||
|
@ -17,7 +17,7 @@ func (Tag9000ExifVersion) EncoderName() string {
|
|||
}
|
||||
|
||||
func (ev Tag9000ExifVersion) String() string {
|
||||
return ev.string
|
||||
return ev.ExifVersion
|
||||
}
|
||||
|
||||
type Codec9000ExifVersion struct {
|
||||
|
@ -35,7 +35,7 @@ func (Codec9000ExifVersion) Encode(value interface{}, byteOrder binary.ByteOrder
|
|||
log.Panicf("can only encode a Tag9000ExifVersion")
|
||||
}
|
||||
|
||||
return []byte(s.string), uint32(len(s.string)), nil
|
||||
return []byte(s.ExifVersion), uint32(len(s.ExifVersion)), nil
|
||||
}
|
||||
|
||||
func (Codec9000ExifVersion) Decode(valueContext *exifcommon.ValueContext) (value EncodeableValue, err error) {
|
||||
|
@ -50,7 +50,11 @@ func (Codec9000ExifVersion) Decode(valueContext *exifcommon.ValueContext) (value
|
|||
valueString, err := valueContext.ReadAsciiNoNul()
|
||||
log.PanicIf(err)
|
||||
|
||||
return Tag9000ExifVersion{valueString}, nil
|
||||
ev := Tag9000ExifVersion{
|
||||
ExifVersion: valueString,
|
||||
}
|
||||
|
||||
return ev, nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
|
|
@ -9,7 +9,7 @@ import (
|
|||
)
|
||||
|
||||
type TagA000FlashpixVersion struct {
|
||||
string
|
||||
FlashpixVersion string
|
||||
}
|
||||
|
||||
func (TagA000FlashpixVersion) EncoderName() string {
|
||||
|
@ -17,7 +17,7 @@ func (TagA000FlashpixVersion) EncoderName() string {
|
|||
}
|
||||
|
||||
func (fv TagA000FlashpixVersion) String() string {
|
||||
return fv.string
|
||||
return fv.FlashpixVersion
|
||||
}
|
||||
|
||||
type CodecA000FlashpixVersion struct {
|
||||
|
@ -35,7 +35,7 @@ func (CodecA000FlashpixVersion) Encode(value interface{}, byteOrder binary.ByteO
|
|||
log.Panicf("can only encode a TagA000FlashpixVersion")
|
||||
}
|
||||
|
||||
return []byte(s.string), uint32(len(s.string)), nil
|
||||
return []byte(s.FlashpixVersion), uint32(len(s.FlashpixVersion)), nil
|
||||
}
|
||||
|
||||
func (CodecA000FlashpixVersion) Decode(valueContext *exifcommon.ValueContext) (value EncodeableValue, err error) {
|
||||
|
@ -50,7 +50,11 @@ func (CodecA000FlashpixVersion) Decode(valueContext *exifcommon.ValueContext) (v
|
|||
valueString, err := valueContext.ReadAsciiNoNul()
|
||||
log.PanicIf(err)
|
||||
|
||||
return TagA000FlashpixVersion{valueString}, nil
|
||||
fv := TagA000FlashpixVersion{
|
||||
FlashpixVersion: valueString,
|
||||
}
|
||||
|
||||
return fv, nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
|
|
@ -9,7 +9,7 @@ import (
|
|||
)
|
||||
|
||||
type Tag0002InteropVersion struct {
|
||||
string
|
||||
InteropVersion string
|
||||
}
|
||||
|
||||
func (Tag0002InteropVersion) EncoderName() string {
|
||||
|
@ -17,7 +17,7 @@ func (Tag0002InteropVersion) EncoderName() string {
|
|||
}
|
||||
|
||||
func (iv Tag0002InteropVersion) String() string {
|
||||
return iv.string
|
||||
return iv.InteropVersion
|
||||
}
|
||||
|
||||
type Codec0002InteropVersion struct {
|
||||
|
@ -35,7 +35,7 @@ func (Codec0002InteropVersion) Encode(value interface{}, byteOrder binary.ByteOr
|
|||
log.Panicf("can only encode a Tag0002InteropVersion")
|
||||
}
|
||||
|
||||
return []byte(s.string), uint32(len(s.string)), nil
|
||||
return []byte(s.InteropVersion), uint32(len(s.InteropVersion)), nil
|
||||
}
|
||||
|
||||
func (Codec0002InteropVersion) Decode(valueContext *exifcommon.ValueContext) (value EncodeableValue, err error) {
|
||||
|
@ -50,7 +50,11 @@ func (Codec0002InteropVersion) Decode(valueContext *exifcommon.ValueContext) (va
|
|||
valueString, err := valueContext.ReadAsciiNoNul()
|
||||
log.PanicIf(err)
|
||||
|
||||
return Tag0002InteropVersion{valueString}, nil
|
||||
iv := Tag0002InteropVersion{
|
||||
InteropVersion: valueString,
|
||||
}
|
||||
|
||||
return iv, nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
|
Loading…
Reference in New Issue