diff options
| author | 2025-03-09 17:47:56 +0100 | |
|---|---|---|
| committer | 2025-12-01 22:08:04 +0100 | |
| commit | b1af8fd87760b34e3ff2fd3bda38f211815a0473 (patch) | |
| tree | 9317fad1a7ec298d7a8d2678e4e422953bbc6f33 /vendor/github.com/dsoprea/go-exif/v3/undefined/accessor.go | |
| parent | [chore] update URLs to forked source (diff) | |
| download | gotosocial-b1af8fd87760b34e3ff2fd3bda38f211815a0473.tar.xz | |
[chore] remove vendor
Diffstat (limited to 'vendor/github.com/dsoprea/go-exif/v3/undefined/accessor.go')
| -rw-r--r-- | vendor/github.com/dsoprea/go-exif/v3/undefined/accessor.go | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/vendor/github.com/dsoprea/go-exif/v3/undefined/accessor.go b/vendor/github.com/dsoprea/go-exif/v3/undefined/accessor.go deleted file mode 100644 index 11a21e1f0..000000000 --- a/vendor/github.com/dsoprea/go-exif/v3/undefined/accessor.go +++ /dev/null @@ -1,62 +0,0 @@ -package exifundefined - -import ( - "encoding/binary" - - "github.com/dsoprea/go-logging" - - "github.com/dsoprea/go-exif/v3/common" -) - -// Encode encodes the given encodeable undefined value to bytes. -func Encode(value EncodeableValue, byteOrder binary.ByteOrder) (encoded []byte, unitCount uint32, err error) { - defer func() { - if state := recover(); state != nil { - err = log.Wrap(state.(error)) - } - }() - - encoderName := value.EncoderName() - - encoder, found := encoders[encoderName] - if found == false { - log.Panicf("no encoder registered for type [%s]", encoderName) - } - - encoded, unitCount, err = encoder.Encode(value, byteOrder) - log.PanicIf(err) - - return encoded, unitCount, nil -} - -// Decode constructs a value from raw encoded bytes -func Decode(valueContext *exifcommon.ValueContext) (value EncodeableValue, err error) { - defer func() { - if state := recover(); state != nil { - err = log.Wrap(state.(error)) - } - }() - - uth := UndefinedTagHandle{ - IfdPath: valueContext.IfdPath(), - TagId: valueContext.TagId(), - } - - decoder, found := decoders[uth] - if found == false { - // We have no choice but to return the error. We have no way of knowing how - // much data there is without already knowing what data-type this tag is. - return nil, exifcommon.ErrUnhandledUndefinedTypedTag - } - - value, err = decoder.Decode(valueContext) - if err != nil { - if err == ErrUnparseableValue { - return nil, err - } - - log.Panic(err) - } - - return value, nil -} |
