402 Commits

Author SHA1 Message Date
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
Dustin Oprea
70b6dc8a1a utility.go: Bugfix for non-FQ IFD-paths in GetFlatExifData 2020-05-16 07:54:40 -04:00
Dustin Oprea
42546383ce ifd_enumerate.go: Bugfix for slice error when processing thumbnails
We were not qualifying our thumbnail tag checks with the IFD that
thumbnails are supposed to live in, and were trying to parse the tags
that happen to share the same tag-IDs as thumbnails.

Fixes #dsoprea/go-jpeg-image-structure/issues/10
2020-05-16 07:32:13 -04:00
Dustin Oprea
5e5d4dcef0 ifd_builder_test.go: Fix inaccurate error message 2020-05-16 06:43:09 -04:00
Dustin Oprea
95ec440155 ifd_enumerate.go: Bugfix for scan() fully-qualified IFD paths not being fully-qualified 2020-05-16 06:42:42 -04:00
Dustin Oprea
86f0767752 ifd.go: Drop old commented IfdIdentity type 2020-05-16 06:38:39 -04:00
Dustin Oprea
f50c93b99c common: Rename exif.go to ifd.go 2020-05-16 05:24:33 -04:00
Dustin Oprea
9bcc8a45c4 Provide EXIF blob size estimates
We now keep track of the further offset that we have accessed (though
not necessarily the furthest offset of data that is unparseable by us).

It sometimes supports debugging efforts to have a ballpark idea of how
much EXIF data there is, rather than just "from the signature to the
end of the file" or however big the EXIF container is in the enclosing
image format. The latter can be buggy or ambiguous.
2020-05-16 03:19:52 -04:00
Dustin Oprea
416fd86ecd ifd_enumerate.go: Rename IfdTagEnumerator to byteParser
It's more accurate, and no longer exported.
2020-05-16 02:51:36 -04:00
Dustin Oprea
5fdad87477 exif-read-tool/main.go: Log size of EXIF blob
Remember that this is typically from the EXIF signature to the end of
the file.
2020-05-16 01:46:26 -04:00
Dustin Oprea
687250767b ifd_enumerate.go: Drop spurious struct field. Put hex prefix on offset in logging. 2020-05-16 01:45:36 -04:00
Dustin Oprea
3ed898edc8 exif.go: Log offset in SearchAndExtractExifWithReader() 2020-05-16 01:44:15 -04:00
Dustin Oprea
5c21ae7376 ifd_enumerate.go: Enrich unknown-type error with type number 2020-05-16 01:03:31 -04:00
Dustin Oprea
9ce7f5d058 ifd_enumerate.go: Fix log subject 2020-05-16 00:52:14 -04:00
Dustin Oprea
e7aea1340c ifd_enumerate.go: Tweak log message 2020-05-06 04:59:28 -04:00
Dustin Oprea
86feeb2b50 ifd_enumerate.go: Log and quietly stop parsing if IFD offset is invalid
Fixes #36
2020-05-06 04:56:05 -04:00
Dustin Oprea
8da3881353 Fix GPS 2.0.0.0 test image name 2020-05-06 01:47:03 -04:00
Dustin Oprea
357e25f102 .travis.yml: Drop older Go versions from CI
It causes us to queue for instances due to quota limits.
2020-05-06 01:42:23 -04:00
Dustin Oprea
6303a275e5 ifd_enumerate.go: Enable support for GPS 2.0.0.0
Fixes #35
2020-05-06 01:42:22 -04:00
Dustin Oprea
c74ff0d0b0 utility.go: Add GpsDegreesEquals 2020-05-06 01:32:01 -04:00
Dustin Oprea
b1ff77dba9 ifd_enumerate.go: Drop TODO 2020-05-05 19:51:12 -04:00
Dustin Oprea
b6593b4cec ifd_builder_test.go: Fix name of example 2020-05-05 11:09:19 -04:00
Dustin Oprea
bbd4b5fb6f ifd_builder_test.go: Add test and example for updating GPS info
- Added helper for getting GPS test-image.
2020-05-05 03:24:01 -04:00
Dustin Oprea
f67048a6e3 Rename package documentation file 2020-05-05 02:46:14 -04:00
Dustin Oprea
05e8551e57 Update package documentation to cite obsolescence 2020-05-05 02:45:22 -04:00
Dustin Oprea
36f5ad93e8 gps.go: Add Raw() method to GpsInfo to assisting with writing
- Moved some GPS logic from ifd_enumerate.go to gps.go .
- Added missing comments.
2020-05-05 02:28:56 -04:00
Dustin Oprea
f86f12408b exif.go: Update funky recover clauses 2020-05-05 02:27:31 -04:00