mirror of https://github.com/dsoprea/go-exif.git
Innocent rename for correctness
- Added comments for all of the "unknown" symbols that will have to be renamed as well. See https://github.com/dsoprea/go-exif/issues/27 .pull/28/head
parent
6c9ad5e3df
commit
f63d2907c8
|
@ -15,6 +15,10 @@ const (
|
||||||
UnparseableUnknownTagValuePlaceholder = "!UNKNOWN"
|
UnparseableUnknownTagValuePlaceholder = "!UNKNOWN"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// TODO(dustin): Rename "unknown" in symbol names to "undefined" in the next release.
|
||||||
|
//
|
||||||
|
// See https://github.com/dsoprea/go-exif/issues/27 .
|
||||||
|
|
||||||
const (
|
const (
|
||||||
TagUnknownType_9298_UserComment_Encoding_ASCII = iota
|
TagUnknownType_9298_UserComment_Encoding_ASCII = iota
|
||||||
TagUnknownType_9298_UserComment_Encoding_JIS = iota
|
TagUnknownType_9298_UserComment_Encoding_JIS = iota
|
||||||
|
@ -75,16 +79,22 @@ var (
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// TODO(dustin): Rename `UnknownTagValue` to `UndefinedTagValue`.
|
||||||
|
|
||||||
type UnknownTagValue interface {
|
type UnknownTagValue interface {
|
||||||
ValueBytes() ([]byte, error)
|
ValueBytes() ([]byte, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(dustin): Rename `TagUnknownType_GeneralString` to `TagUnknownType_GeneralString`.
|
||||||
|
|
||||||
type TagUnknownType_GeneralString string
|
type TagUnknownType_GeneralString string
|
||||||
|
|
||||||
func (gs TagUnknownType_GeneralString) ValueBytes() (value []byte, err error) {
|
func (gs TagUnknownType_GeneralString) ValueBytes() (value []byte, err error) {
|
||||||
return []byte(gs), nil
|
return []byte(gs), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(dustin): Rename `TagUnknownType_9298_UserComment` to `TagUndefinedType_9298_UserComment`.
|
||||||
|
|
||||||
type TagUnknownType_9298_UserComment struct {
|
type TagUnknownType_9298_UserComment struct {
|
||||||
EncodingType int
|
EncodingType int
|
||||||
EncodingBytes []byte
|
EncodingBytes []byte
|
||||||
|
@ -116,6 +126,8 @@ func (uc TagUnknownType_9298_UserComment) ValueBytes() (value []byte, err error)
|
||||||
return value, nil
|
return value, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(dustin): Rename `TagUnknownType_927C_MakerNote` to `TagUndefinedType_927C_MakerNote`.
|
||||||
|
|
||||||
type TagUnknownType_927C_MakerNote struct {
|
type TagUnknownType_927C_MakerNote struct {
|
||||||
MakerNoteType []byte
|
MakerNoteType []byte
|
||||||
MakerNoteBytes []byte
|
MakerNoteBytes []byte
|
||||||
|
@ -141,6 +153,8 @@ func (uc TagUnknownType_927C_MakerNote) ValueBytes() (value []byte, err error) {
|
||||||
return uc.MakerNoteBytes, nil
|
return uc.MakerNoteBytes, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(dustin): Rename `TagUnknownType_9101_ComponentsConfiguration` to `TagUndefinedType_9101_ComponentsConfiguration`.
|
||||||
|
|
||||||
type TagUnknownType_9101_ComponentsConfiguration struct {
|
type TagUnknownType_9101_ComponentsConfiguration struct {
|
||||||
ConfigurationId int
|
ConfigurationId int
|
||||||
ConfigurationBytes []byte
|
ConfigurationBytes []byte
|
||||||
|
@ -154,6 +168,8 @@ func (uc TagUnknownType_9101_ComponentsConfiguration) ValueBytes() (value []byte
|
||||||
return uc.ConfigurationBytes, nil
|
return uc.ConfigurationBytes, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(dustin): Rename `EncodeUnknown_9286` to `EncodeUndefined_9286`.
|
||||||
|
|
||||||
func EncodeUnknown_9286(uc TagUnknownType_9298_UserComment) (encoded []byte, err error) {
|
func EncodeUnknown_9286(uc TagUnknownType_9298_UserComment) (encoded []byte, err error) {
|
||||||
defer func() {
|
defer func() {
|
||||||
if state := recover(); state != nil {
|
if state := recover(); state != nil {
|
||||||
|
@ -207,6 +223,8 @@ func EncodeUndefined(ifdPath string, tagId uint16, value interface{}) (ed Encode
|
||||||
return EncodedData{}, nil
|
return EncodedData{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(dustin): Rename `TagUnknownType_UnknownValue` to `TagUndefinedType_UnknownValue`.
|
||||||
|
|
||||||
type TagUnknownType_UnknownValue []byte
|
type TagUnknownType_UnknownValue []byte
|
||||||
|
|
||||||
func (tutuv TagUnknownType_UnknownValue) String() string {
|
func (tutuv TagUnknownType_UnknownValue) String() string {
|
||||||
|
@ -309,7 +327,7 @@ func UndefinedValue(ifdPath string, tagId uint16, valueContext interface{}, byte
|
||||||
// TODO(dustin): Doesn't work, but here as an example.
|
// TODO(dustin): Doesn't work, but here as an example.
|
||||||
// ie := NewIfdEnumerate(valueBytes, byteOrder)
|
// ie := NewIfdEnumerate(valueBytes, byteOrder)
|
||||||
|
|
||||||
// // TODO(dustin): !! Validate types (might have proprietary types, but it might be worth splitting the list between valid and not validate; maybe fail if a certain proportion are invalid, or maybe aren't less then a certain small integer)?
|
// // TODO(dustin): !! Validate types (might have proprietary types, but it might be worth splitting the list between valid and not valid; maybe fail if a certain proportion are invalid, or maybe aren't less then a certain small integer)?
|
||||||
// ii, err := ie.Collect(0x0)
|
// ii, err := ie.Collect(0x0)
|
||||||
|
|
||||||
// for _, entry := range ii.RootIfd.Entries {
|
// for _, entry := range ii.RootIfd.Entries {
|
Loading…
Reference in New Issue