Commit Graph

16 Commits (d21ac8e2de85274733c163a2e1f62d8bb239c31d)

Author SHA1 Message Date
Dustin Oprea cb1753e83a ifd_enumerate.go: Handle cycles in next-IFD offsets
Fixes #59
2021-05-12 00:20:36 -04:00
Dustin Oprea d42f8ce9cd tags.go: Add 'universal tags' support
- This will allow tags to be matched from any IFD if not found in the
  primary and to go with whatever type is encoded into the tag even if
  it disagrees with what is officially supported.

Supports https://github.com/dsoprea/go-exif/issues/53
2021-01-31 17:56:44 -05:00
Dustin Oprea 4ec6f89b9f ifd_enumerate.go: Fix warning message for unsupported type 2021-01-31 17:15:54 -05:00
Dustin Oprea 0d9ceeb35b exif.go: Add support for seeking to multiple EXIF blobs (SearchAndExtractExifN)
- ifd_enumerate.go
  - Bugfixes for various broken log messages.
  - Bugfix for ErrTagNotFound not actually skipping.

- common/parser.go: Parsing ASCII now panics if there's binary (8-bit)
  characters.
  - utility.go: GetFlatExifData() just logs and skips these.

- exif.go: Add searchAndExtractExifWithReaderWithDiscarded(), to return
  how many bytes it seeks through.

Supports https://github.com/dsoprea/go-exif/issues/53
2021-01-31 17:15:48 -05:00
Dustin Oprea 089aa48c91 ifd_enumerate.go: Bugfix for not skipping unknown tags 2020-08-07 03:52:13 -04:00
Dustin Oprea 74a1612f20 v3/ifd_enumerate: Skip tags that have a divergent embedded type
This should mitigate most issues where the same tag appears multiple
times with different types. This happens more than you would think that
it would.

- ErrTagTypeNotValid is now returned unwrapped.
  - This is typically the convention for static error messages.

https://github.com/photoprism/photoprism/issues/431
2020-07-31 04:03:32 -04:00
Dustin Oprea 33ee3a8313 ifd_enumerate.go: Do not allow unnecessary thumbnail read to disrupt enumeration 2020-07-21 23:35:36 -04:00
Dustin Oprea 46b1a0cd17 ifd_enumerate.go: Add date normalization. Skip altitude if zero denominator.
Fixes #43
2020-07-17 02:39:59 -04:00
Dustin Oprea 4675ba7529 ifd_enumerate.go: Add NextIfd() accessor
- Supports go-exif-knife.
2020-07-17 00:54:38 -04:00
Dustin Oprea f93c06e0d6 v3: Fix import naming glitch 2020-07-16 21:33:45 -04:00
Dustin Oprea d19e38a723 backwards incompatible: ifd_enumerate.go: Drop fqIfdPath and ifdIndex from visitor function signature 2020-07-11 13:15:18 -04:00
Dustin Oprea f2c3d1c0ec backwards incompatible: ifd_enumerate.go: Stop exporting Ifd fields
Finally.
2020-07-11 13:15:18 -04:00
Dustin Oprea 7ca1c7b13e backwards incompatible: GetFlatExifData(), Scan(), and Visit() all take a ScanOptions struct now 2020-07-11 13:15:18 -04:00
Dustin Oprea 83b844408c backwards incompatible: Stop exporting ParseOneIfd and ParseOneTag 2020-07-11 13:15:18 -04:00
Dustin Oprea 312218d7b1 Use encapsulated data/reader rather than bytes
Given a stream of data, it is possible to determine the beginning of
EXIF data but not the end. Therefore, either an image-aware
implementation must know how to parse an image and extract the EXIF
data or a brute-force search implementation (one of which is provided
by this project) must find the start anchor and then return all bytes
from that to the end of the file.

We have been made aware of some use-cases where a brute-force search
might be unavoidable due to trust or stability issues with the image
structure. This leads to large allocations. This can be avoided by
accomodating support that will allow for both a byte-slice or an
`io.ReadSeeker`. Since the EXIF structure is typically not read-
intensive (a couple of kilobytes if no thumbnail is present), this
should have a minimal performance impact.

Closes #42
2020-07-11 12:12:48 -04:00
Dustin Oprea 56058635d0 Seed v3 release. Copy from v2 release. 2020-07-11 12:12:48 -04:00