Commit Graph

328 Commits (a350bacdacec3b07191d5d9224b12b5204d12d2f)

Author SHA1 Message Date
Dustin Oprea a350bacdac exif.go: Use constant symbol rather than literal 2020-06-04 01:37:20 -04:00
Dustin Oprea 7a76510c2b Revert "Refactor module-detection to use go/build instead of static file"
This reverts commit c23f7a1066.

The package-path will be a build-path rather than a source-path, and any
assets being referred to will not be found.
2020-06-04 01:37:15 -04:00
Dustin Oprea eb6d1c16a5 Revert "common/testing_common.go: Bugfix for package-path finder"
This reverts commit 77cb76cd34.

The package-path will be a build-path rather than a source-path, and any
assets being referred to will not be found.
2020-06-04 01:35:32 -04:00
Dustin Oprea 77cb76cd34 common/testing_common.go: Bugfix for package-path finder 2020-06-02 15:01:38 -04:00
Dustin Oprea c23f7a1066 Refactor module-detection to use go/build instead of static file 2020-06-02 04:23:08 -04:00
Dustin Oprea e46688a494 .travis.yml: Bugfix for no module support in CI
Tip of dependency is broken and it was affecting us:

https://github.com/go-errors/errors/issues/27

- We also disabled 1.10 and 1.11 due to lack of support in dependencies now that we're being recognized as a module.
2020-06-01 01:33:14 -04:00
Dustin Oprea 87d01d1392 Revert ".travis.yml: Disable V1 CI. Dependencies currently broken and this version is very legacy and very unsupported."
This reverts commit d1728617c7.

Not having desired effect.
2020-06-01 00:28:09 -04:00
Dustin Oprea d1728617c7 .travis.yml: Disable V1 CI. Dependencies currently broken and this version is very legacy and very unsupported.
https://github.com/go-errors/errors/issues/27
2020-06-01 00:21:43 -04:00
Dustin Oprea a06d9b9e40 ifd_tag_entry.go: Bugfix for GetRawBytes() mishandling error from exifundefined.Decode()
if `Decode()` returns `exifcommon.ErrUnhandledUndefinedTypedTag` it just
falls through, but should have been returning
`exifundefined.ErrUnparseableValue`.

- Also, `GetRawBytes()` was missing the recover clause for blanket error
  handler.
2020-05-31 11:14:09 -04:00
Dustin Oprea 1a62daf305 ifd.go: Moved implementations of IfdMapping and LoadStandardIfds to exifcommon.ifd
In lieu of dropping in next release. We needed this in order to write
some unit-tests for exifcommon functionality, and this is common
functionality anyway (by any definition of common thus far).

- common/ifd.go: Added NewIfdIdentityFromString. The above allowed us to
  cover this with unit-tests.
  - This was required for go-exif-knife, to get IFD-paths from the
    command-line.
2020-05-27 12:50:02 -04:00
Dustin Oprea 2a1e3f0fa1 ifd_enumerate.go: Add call to postparseTag() after parseTag() in ParseOneTag()
- Should have been in previous
2020-05-27 00:29:08 -04:00
Dustin Oprea fb98f429ee We now guess at alternative IFDs for invalid tags automatically
This required some backtracking on a change we just pushed a little
while ago.
2020-05-27 00:29:03 -04:00
Dustin Oprea b4c2ca5765 tags.go: Bugfix for bad FindFirst() error handling and not returning if not found
- utility.go: Add GetExifData() to return flat tags and extra data and
  to allow guessing of tags for misplaced IFDs.

- exif-read-tool/main.go: Implement tag guessing
2020-05-26 21:28:27 -04:00
Dustin Oprea df74da8384 tags_data.go: Drop non-standard tags having non-standard, undocumented types 2020-05-26 21:14:23 -04:00
Dustin Oprea de4b8921bd Log guesses about implementation incongruities for invalid tags
2020/05/25 19:21:33 exif.utility: [WARNING]  Tag with ID (0x0201) in IFD [IFD/Exif] is not recognized and will be ignored.
2020/05/25 19:21:33 exif.utility: [WARNING]  (cont'd) Tag [JPEGInterchangeFormat] with the same ID has been found in IFD [IFD] and may be related. The tag you were looking for might have been written to the wrong IFD by a buggy implementation.
2020/05/25 19:21:33 exif.utility: [WARNING]  Tag with ID (0x0202) in IFD [IFD/Exif] is not recognized and will be ignored.
2020/05/25 19:21:33 exif.utility: [WARNING]  (cont'd) Tag [JPEGInterchangeFormatLength] with the same ID has been found in IFD [IFD] and may be related. The tag you were looking for might have been written to the wrong IFD by a buggy implementation.

Closes #38
2020-05-25 19:22:47 -04:00
Dustin Oprea 75b5552112 tags.go: 'Get' functions now take an exifcommon.IfdIdentity 2020-05-24 11:07:46 -04:00
Dustin Oprea 1a12aec48f utility.go: Drop FqIfdPath. Now fully obsolete. 2020-05-20 15:12:04 -04:00
Dustin Oprea 015129a9ef Use RELEASE() notes to denote future backwards-incompatible TODOs 2020-05-20 14:33:28 -04:00
Dustin Oprea 957b817f85 ifd_enumerate.go: Tweak variable name 2020-05-20 14:31:49 -04:00
Dustin Oprea 08ac8466dd ifd.go: Add type system for IFD IDs, names, and paths
This allows us to pass around individual tokens that we can use to
generate IDs, names, and qualified and non-qualified IFD paths, rather
than [necessarily] having to pass or store them individually.

The previous global variables were strings. Now they are IfdIdentity structs
and have been renamed to be more accurate (in general, as well as for this).
The previous variables have been kept but are now just assigned to the newer
variables. This is backwards-compatibility that will be removed in the future.
2020-05-20 14:07:16 -04:00
Dustin Oprea 40de7cc624 ifd.go: Add missing comments 2020-05-20 14:04:00 -04:00
Dustin Oprea 04a4b5ce62 README.md: Move v2 notes to bottom. Add notes about IFD and tag customization. 2020-05-20 01:00:53 -04:00
Dustin Oprea 1b9bb61b5f ifd_enumerate.go: Stop exporting `ParseIfd()` 2020-05-19 03:41:06 -04:00
Dustin Oprea 3cdb59fd80 exif-read-tool: Fix unit-tests and remove unnecessary conditional for 4686c99 2020-05-19 02:47:07 -04:00
Dustin Oprea 753e5191d6 utility.go: Reduce duplication in `GetFlatExifData()` and just use `Scan()` 2020-05-19 02:47:07 -04:00
Dustin Oprea 0f18278742 go.mod: Bugfix for accidental commit 2020-05-19 02:47:06 -04:00
Dustin Oprea 71d0c799d3 Bugfix for some tags failing encoding due to more than one supported type
This was a recently introduced, preexisting bug caused by adding support
for multiple types for certain tags. This suddenly became an issue when
we added all remaining additional types and at least one of these was in
our testing data.
2020-05-19 02:32:43 -04:00
Dustin Oprea 15666b6093 exif-read-tool/main_test.go: Fix usage from tests for go-flags change 2020-05-18 22:37:37 -04:00
Dustin Oprea 76635a8c89 utility.go: Bugfix for excessive loading and reloading of tag-indices 2020-05-18 01:23:35 -04:00
Dustin Oprea 4686c99e3c exif-read-tool/main.go: Just use GetFlatExifData() instead of our own visitor process 2020-05-18 01:16:27 -04:00
Dustin Oprea 8e727e3388 ifd_enumerate.go: We now log the approximate size of the EXIF blob 2020-05-18 01:15:29 -04:00
Dustin Oprea af2e8222eb utility.go: ExifTag now has UnitCount field 2020-05-18 01:14:56 -04:00
Dustin Oprea 7aa41d6d0d ifd_enumerate.go: Add missing comments 2020-05-18 00:50:10 -04:00
Dustin Oprea 6629fe3012 tags.go: Tweak tag-registration logging verbiage 2020-05-18 00:21:25 -04:00
Dustin Oprea 4857cb0b30 exif-read-tool/main.go: Can now suppress the tag output 2020-05-18 00:12:54 -04:00
Dustin Oprea e1d21a3716 exif-read-tool/main.go: Use go-flags for command-line processing 2020-05-18 00:09:14 -04:00
Dustin Oprea d0d0f14dea tags_data.go: FNumber and ExposureTime can now be decoded if SRATIONAL 2020-05-17 20:16:53 -04:00
Dustin Oprea 29b0ff2256 tags_data.go: Bugfix for some standard tags being ignored 2020-05-17 19:41:48 -04:00
Dustin Oprea d2495e29dd utility.go: Skip unknown tags in GetFlatExifData
This makes its behavior consistent with other iteration/enumeration
functions and also mitigates handling errors by unsuspecting callers.
2020-05-17 19:40:38 -04:00
Dustin Oprea 232d5acc36 ifd_enumerate.go: Log that the thumbnail tags were found but being handled elsewhere
This might mitigate confusion since they are, technically, present.
2020-05-17 19:39:26 -04:00
Dustin Oprea 13045756c5 go.mod: Bump go-logging
- Bring in Is() changes.
2020-05-17 19:36:03 -04:00
Dustin Oprea c9be4b30b0 tags.go: TagIndex now supports multiple types for a single tag
Apparently PixelXDimension and PixelYDimension can official be a SHORT
*or* a LONG, and, now that we're skipping anything that doesn't agree
with the index, it broke some tests.
2020-05-17 04:05:29 -04:00
Dustin Oprea 3310e4b8c8 ifd_enumerate.go: Skip tags that have a divergent type
This also mitigates the processing of duplicate tags (which should never
occur) if the duplicate tags also happen to have unexpected types (our
current scenario).

2020/05/17 02:26:37 exif.ifd_enumerate: [DEBUG]  IFD [IFD/GPSInfo] tag-count: (10)
2020/05/17 02:26:37 exif.ifd_enumerate: [WARNING]  Skipping tag [IFD/GPSInfo] (0x0005) [GPSAltitudeRef] with an unexpected type: (5) [RATIONAL] != (1) [BYTE]
2020/05/17 02:26:37 exif.ifd_enumerate: [WARNING]  Skipping tag [IFD/GPSInfo] (0x001b) [GPSProcessingMethod] with an unexpected type: (2) [ASCII] != (7) [UNDEFINED]
2020/05/17 02:26:37 exif.ifd_enumerate: [DEBUG]  Next IFD at offset: (00000000)

Fixes #37
2020-05-17 02:29:36 -04:00
Dustin Oprea e1b21b5186 tags.go: (TagIndex).Get() now returns ErrTagNotFound rather than panics
This is a managed error scenario.

- Added missing comments.
2020-05-17 02:28:17 -04:00
Dustin Oprea 998844ba08 ifd_enumerate.go: PrintTagTree now skips the thumbnail tags
It prints a lot of noise when this does actually relate to saving the
thumbnail image.
2020-05-17 01:28:11 -04:00
Dustin Oprea 7f6eb3d9f3 utility.go: Add formatted values to ExifTag 2020-05-16 17:31:02 -04:00
Dustin Oprea 220964731d ifd_enumerate.go: Bugfix for ITEs not representing fully-qualified IFD paths
- This resulted in the lookup table having unique entries, and therefore
  no longer needing its values to be slices. We are going to fix this.
  It is not a backwards-compatible change, but this is a fairly internal
  internal functionality.

- Add simple accessors to determine if a thumbnail offset or size.
2020-05-16 17:18:57 -04:00
Dustin Oprea efa6e2d6c0 ifd_builder_test.go: Fix test 2020-05-16 16:47:03 -04:00
Dustin Oprea a45cc7cfd5 exif-read-tool/main.go: Example tool can now dump the thumbnail 2020-05-16 08:21:16 -04:00
Dustin Oprea 71e87d5e22 ifd_enumerate.go:
- Invalid tag-type sets the tag-ID so that we can include it in the log.
- Other logging enhancements.
  - Removed newline

- Incorporate the thumbnail into the furthest-offset counter.
- Thumbnail() no longer panics ErrNoThumbnail and just returns it.
  - This is a managed error, not a true panic condition.

- Collect() now builds index with FQ IFD paths, not non-FQ.
2020-05-16 08:21:12 -04:00