diff options
Diffstat (limited to 'vendor/github.com/dsoprea/go-jpeg-image-structure')
-rw-r--r-- | vendor/github.com/dsoprea/go-jpeg-image-structure/.travis.yml | 21 | ||||
-rw-r--r-- | vendor/github.com/dsoprea/go-jpeg-image-structure/v2/.MODULE_ROOT (renamed from vendor/github.com/dsoprea/go-jpeg-image-structure/.MODULE_ROOT) | 0 | ||||
-rw-r--r-- | vendor/github.com/dsoprea/go-jpeg-image-structure/v2/LICENSE (renamed from vendor/github.com/dsoprea/go-jpeg-image-structure/LICENSE) | 0 | ||||
-rw-r--r-- | vendor/github.com/dsoprea/go-jpeg-image-structure/v2/README.md (renamed from vendor/github.com/dsoprea/go-jpeg-image-structure/README.md) | 4 | ||||
-rw-r--r-- | vendor/github.com/dsoprea/go-jpeg-image-structure/v2/markers.go (renamed from vendor/github.com/dsoprea/go-jpeg-image-structure/markers.go) | 0 | ||||
-rw-r--r-- | vendor/github.com/dsoprea/go-jpeg-image-structure/v2/media_parser.go (renamed from vendor/github.com/dsoprea/go-jpeg-image-structure/media_parser.go) | 13 | ||||
-rw-r--r-- | vendor/github.com/dsoprea/go-jpeg-image-structure/v2/segment.go (renamed from vendor/github.com/dsoprea/go-jpeg-image-structure/segment.go) | 11 | ||||
-rw-r--r-- | vendor/github.com/dsoprea/go-jpeg-image-structure/v2/segment_list.go (renamed from vendor/github.com/dsoprea/go-jpeg-image-structure/segment_list.go) | 29 | ||||
-rw-r--r-- | vendor/github.com/dsoprea/go-jpeg-image-structure/v2/splitter.go (renamed from vendor/github.com/dsoprea/go-jpeg-image-structure/splitter.go) | 0 | ||||
-rw-r--r-- | vendor/github.com/dsoprea/go-jpeg-image-structure/v2/testing_common.go (renamed from vendor/github.com/dsoprea/go-jpeg-image-structure/testing_common.go) | 0 | ||||
-rw-r--r-- | vendor/github.com/dsoprea/go-jpeg-image-structure/v2/utility.go (renamed from vendor/github.com/dsoprea/go-jpeg-image-structure/utility.go) | 0 |
11 files changed, 46 insertions, 32 deletions
diff --git a/vendor/github.com/dsoprea/go-jpeg-image-structure/.travis.yml b/vendor/github.com/dsoprea/go-jpeg-image-structure/.travis.yml deleted file mode 100644 index 4c79875ed..000000000 --- a/vendor/github.com/dsoprea/go-jpeg-image-structure/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -language: go -go: - - master - - stable - - "1.14" - - "1.13" - - "1.12" -env: - - GO111MODULE=on -install: - - go get -t ./... -script: -# v1 - - go test -v . -# v2 - - cd v2 - - go test -v ./... -coverprofile=coverage.txt -covermode=atomic - - cd .. -after_success: - - cd v2 - - curl -s https://codecov.io/bash | bash diff --git a/vendor/github.com/dsoprea/go-jpeg-image-structure/.MODULE_ROOT b/vendor/github.com/dsoprea/go-jpeg-image-structure/v2/.MODULE_ROOT index e69de29bb..e69de29bb 100644 --- a/vendor/github.com/dsoprea/go-jpeg-image-structure/.MODULE_ROOT +++ b/vendor/github.com/dsoprea/go-jpeg-image-structure/v2/.MODULE_ROOT diff --git a/vendor/github.com/dsoprea/go-jpeg-image-structure/LICENSE b/vendor/github.com/dsoprea/go-jpeg-image-structure/v2/LICENSE index 163291ed6..163291ed6 100644 --- a/vendor/github.com/dsoprea/go-jpeg-image-structure/LICENSE +++ b/vendor/github.com/dsoprea/go-jpeg-image-structure/v2/LICENSE diff --git a/vendor/github.com/dsoprea/go-jpeg-image-structure/README.md b/vendor/github.com/dsoprea/go-jpeg-image-structure/v2/README.md index 67bc57617..bf60ef504 100644 --- a/vendor/github.com/dsoprea/go-jpeg-image-structure/README.md +++ b/vendor/github.com/dsoprea/go-jpeg-image-structure/v2/README.md @@ -1,5 +1,5 @@ -[](https://travis-ci.org/dsoprea/go-jpeg-image-structure) -[](https://codecov.io/gh/dsoprea/go-jpeg-image-structure) +[](https://travis-ci.org/dsoprea/go-jpeg-image-structure/v2) +[](https://codecov.io/gh/dsoprea/go-jpeg-image-structure) [](https://goreportcard.com/report/github.com/dsoprea/go-jpeg-image-structure/v2) [](https://godoc.org/github.com/dsoprea/go-jpeg-image-structure/v2) diff --git a/vendor/github.com/dsoprea/go-jpeg-image-structure/markers.go b/vendor/github.com/dsoprea/go-jpeg-image-structure/v2/markers.go index a12171bd8..a12171bd8 100644 --- a/vendor/github.com/dsoprea/go-jpeg-image-structure/markers.go +++ b/vendor/github.com/dsoprea/go-jpeg-image-structure/v2/markers.go diff --git a/vendor/github.com/dsoprea/go-jpeg-image-structure/media_parser.go b/vendor/github.com/dsoprea/go-jpeg-image-structure/v2/media_parser.go index dd4c73af9..e6fc60bc4 100644 --- a/vendor/github.com/dsoprea/go-jpeg-image-structure/media_parser.go +++ b/vendor/github.com/dsoprea/go-jpeg-image-structure/v2/media_parser.go @@ -3,11 +3,14 @@ package jpegstructure import ( "bufio" "bytes" + "image" "io" "os" + "image/jpeg" + "github.com/dsoprea/go-logging" - "github.com/dsoprea/go-utility/image" + "github.com/dsoprea/go-utility/v2/image" ) // JpegMediaParser is a `riimage.MediaParser` that knows how to parse JPEG @@ -122,6 +125,14 @@ func (jmp *JpegMediaParser) LooksLikeFormat(data []byte) bool { return true } +// GetImage returns an image.Image-compatible struct. +func (jmp *JpegMediaParser) GetImage(r io.Reader) (img image.Image, err error) { + img, err = jpeg.Decode(r) + log.PanicIf(err) + + return img, nil +} + var ( // Enforce interface conformance. _ riimage.MediaParser = new(JpegMediaParser) diff --git a/vendor/github.com/dsoprea/go-jpeg-image-structure/segment.go b/vendor/github.com/dsoprea/go-jpeg-image-structure/v2/segment.go index d6a1c42bb..6b433bf1f 100644 --- a/vendor/github.com/dsoprea/go-jpeg-image-structure/segment.go +++ b/vendor/github.com/dsoprea/go-jpeg-image-structure/v2/segment.go @@ -8,11 +8,12 @@ import ( "crypto/sha1" "encoding/hex" - "github.com/dsoprea/go-exif/v2" + "github.com/dsoprea/go-exif/v3" + "github.com/dsoprea/go-exif/v3/common" "github.com/dsoprea/go-iptc" "github.com/dsoprea/go-logging" "github.com/dsoprea/go-photoshop-info-format" - "github.com/dsoprea/go-utility/image" + "github.com/dsoprea/go-utility/v2/image" ) const ( @@ -125,7 +126,9 @@ func (s *Segment) Exif() (rootIfd *exif.Ifd, data []byte, err error) { jpegLogger.Debugf(nil, "Attempting to parse (%d) byte EXIF blob (Exif).", len(rawExif)) - im := exif.NewIfdMappingWithStandard() + im, err := exifcommon.NewIfdMappingWithStandard() + log.PanicIf(err) + ti := exif.NewTagIndex() _, index, err := exif.Collect(im, ti, rawExif) @@ -150,7 +153,7 @@ func (s *Segment) FlatExif() (exifTags []exif.ExifTag, err error) { jpegLogger.Debugf(nil, "Attempting to parse (%d) byte EXIF blob (FlatExif).", len(rawExif)) - exifTags, err = exif.GetFlatExifData(rawExif) + exifTags, _, err = exif.GetFlatExifData(rawExif, nil) log.PanicIf(err) return exifTags, nil diff --git a/vendor/github.com/dsoprea/go-jpeg-image-structure/segment_list.go b/vendor/github.com/dsoprea/go-jpeg-image-structure/v2/segment_list.go index 1b5b06a3a..b4f4d5810 100644 --- a/vendor/github.com/dsoprea/go-jpeg-image-structure/segment_list.go +++ b/vendor/github.com/dsoprea/go-jpeg-image-structure/v2/segment_list.go @@ -8,7 +8,8 @@ import ( "crypto/sha1" "encoding/binary" - "github.com/dsoprea/go-exif/v2" + "github.com/dsoprea/go-exif/v3" + "github.com/dsoprea/go-exif/v3/common" "github.com/dsoprea/go-iptc" "github.com/dsoprea/go-logging" ) @@ -241,11 +242,31 @@ func (sl *SegmentList) ConstructExifBuilder() (rootIb *exif.IfdBuilder, err erro }() rootIfd, _, err := sl.Exif() - log.PanicIf(err) + if log.Is(err, exif.ErrNoExif) == true { + // No EXIF. Just create a boilerplate builder. + + im := exifcommon.NewIfdMapping() + + err := exifcommon.LoadStandardIfds(im) + log.PanicIf(err) + + ti := exif.NewTagIndex() + + rootIb := + exif.NewIfdBuilder( + im, + ti, + exifcommon.IfdStandardIfdIdentity, + exifcommon.EncodeDefaultByteOrder) + + return rootIb, nil + } else if err != nil { + log.Panic(err) + } - ib := exif.NewIfdBuilderFromExistingChain(rootIfd) + rootIb = exif.NewIfdBuilderFromExistingChain(rootIfd) - return ib, nil + return rootIb, nil } // DumpExif returns an unstructured list of tags (useful when just reviewing). diff --git a/vendor/github.com/dsoprea/go-jpeg-image-structure/splitter.go b/vendor/github.com/dsoprea/go-jpeg-image-structure/v2/splitter.go index 8e9c7c020..8e9c7c020 100644 --- a/vendor/github.com/dsoprea/go-jpeg-image-structure/splitter.go +++ b/vendor/github.com/dsoprea/go-jpeg-image-structure/v2/splitter.go diff --git a/vendor/github.com/dsoprea/go-jpeg-image-structure/testing_common.go b/vendor/github.com/dsoprea/go-jpeg-image-structure/v2/testing_common.go index e7169c2f0..e7169c2f0 100644 --- a/vendor/github.com/dsoprea/go-jpeg-image-structure/testing_common.go +++ b/vendor/github.com/dsoprea/go-jpeg-image-structure/v2/testing_common.go diff --git a/vendor/github.com/dsoprea/go-jpeg-image-structure/utility.go b/vendor/github.com/dsoprea/go-jpeg-image-structure/v2/utility.go index 1c618ba6d..1c618ba6d 100644 --- a/vendor/github.com/dsoprea/go-jpeg-image-structure/utility.go +++ b/vendor/github.com/dsoprea/go-jpeg-image-structure/v2/utility.go |