Commit Graph

33 Commits (4e059a6b958d1142599629cfcc28f08bf0709bf3)

Author SHA1 Message Date
Dustin Oprea 4e059a6b95 Drop inline RELEASE TO-DOs from v2. They are now active tasks in v3. 2020-07-11 12:12:48 -04:00
Dustin Oprea bd6037a0b8 Bugfixes to previous report-card fixes 2020-06-12 02:13:50 -04:00
Dustin Oprea 9743a98845 Revert "Revert "Report-card fixes""
This reverts commit 4450f89e048a2373cd82a911725b6c54d22632eb.

The next commit has the fixes.
2020-06-12 02:13:36 -04:00
Dustin Oprea 591504aef0 Revert "Report-card fixes"
This reverts commit eb5bd13c98.

Introduced some new issues, here. This is being debugged on a separate
branch.

Fixes #41
2020-06-12 01:52:09 -04:00
Dustin Oprea eb5bd13c98 Report-card fixes 2020-06-10 16:11:13 -04:00
Dustin Oprea 7edf52b885 Timestamps can now be set directly 2020-06-07 01:33:12 -04:00
Dustin Oprea d69a43ee6a common/testing_common.go: Bugfix for empty module-path introduced by recent commit 2020-06-07 00:55:05 -04:00
Dustin Oprea ca8584a0e1 Minor sensible testing refactors 2020-06-04 15:34:36 -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 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 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 015129a9ef Use RELEASE() notes to denote future backwards-incompatible TODOs 2020-05-20 14:33:28 -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 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 5c21ae7376 ifd_enumerate.go: Enrich unknown-type error with type number 2020-05-16 01:03:31 -04:00
Dustin Oprea bd04addaf4 v2/common/parser.go: Revert to previous NUL forgiveness
It turns out that there is so much loose handling with the terminating
NUL characters out there that there's a societal breakdown without this.

Fixes #31
2020-01-26 00:26:15 -05:00
Dustin Oprea 90b66e3d11 Renamed V2 constant
From ErrUnhandledUnknownTypedTag to ErrUnhandledUndefinedTypedTag. The
release just happened. There should be minimal fallout.
2020-01-13 13:44:00 -05:00
Dustin Oprea eee9ff13c7 Removed init()'s from tests so they don't run when imported
Otherwise they'll break for other projects' tests. We now initialize our
paths on-demand, which will only happen when running from our own tests.
2020-01-13 12:00:23 -05:00
Dustin Oprea ebd20ffc59 Do not include v1/legacy in coverage 2020-01-12 18:56:35 -05:00
Dustin Oprea 3b18b2295e common/testing_common.go: Tighten error checking for module-find 2020-01-12 18:56:35 -05:00
Dustin Oprea db9a0b3a24 common/testing_common.go: Add verbosity for module-path find failure 2020-01-12 18:56:35 -05:00
Dustin Oprea 817d4b2856 Fix module resolution with subpackages
exif-read-tool/main_test.go: Fix test broken by moving to V2.
2020-01-12 18:56:35 -05:00
Dustin Oprea 1bdfa9b10e Empower ITEs to resolve values and raw bytes directly
They'll also now embed all of the information they need to know since it
is all known where the ITEs are created. This prevents the user from
having to be involved in it. This makes it much more straightforward and
enjoyable to use.

- ifd_tag_entry.go
  - newIfdTagEntry now takes and embeds `addressableBytes` and
    `byteOrder`.
  - We've dumped the `value` member that let the caller preload a parsed
    value (or bytes?). It's no longer necessary since this led to
    inconsistencies and the ITE can produce these values directly, now.
  - `Value()` obviously no longer takes `addressableValue` and
    `byteOrder` since now embedded.
  - `Value()` will now see and return ErrUnhandledUnknownTypedTag
    directly (not wrapping it, since this is a handled case).

- common/type.go: FormatFromType now uses Stringer as a fallback if
  possible. All undefined-tag wrapper types implement it, so the same
  function can handle both undefined and non-undefined values, and the
  individual types can control the strings presented in simple listing.

- Dropped "resolveValue" parameters from all of the collect, visit, and
  parsing functions. Resolution is now a later step performed by the
  caller on the ITEs, directly.

  - This parameter was protection against undefined-type values
    disrupting simple enumeration, but now the user can simply produce
    the list of tags and can either choose to decode their value or not,
    directly. If they do, they, as of earlier, recent commits, also have
    the ability to properly manage unhandled undefined-values so they
    don't crash.

- The ITEs can now create ValueContext structs directly
  (GetValueContext()), though it might not be necessary now that the
  ITEs can produce the values and encodings directly.

  - This also allowed us to dump several other GetValueContext()
    implementations elsewhere since it is now self-reliant on this type
    and those methods were essentially kludges for the lack of this.

- Dump a bunch of "Value" methods from ITEs which just weren't useful or
  simple enough. Replaced by the above.

- Fixed `(Ifd).String()` to have a pointer receiver.
2020-01-12 18:56:35 -05:00
Dustin Oprea 6554f89879 common/type.go: Rename Format() to FormatFromBytes() 2020-01-12 18:56:35 -05:00
Dustin Oprea 9441507683 common/parser.go: An ASCII string not being terminated with NUL now panics
This likely means an offset error or something else that's very bad. We
shouldn't be forgiving it.
2020-01-12 18:56:35 -05:00
Dustin Oprea 351f1b7549 undefined/type.go: Formalized requirement for undefined-types being Stringers 2020-01-12 18:56:35 -05:00
Dustin Oprea 32a5d88770 New integration of common/ and undefined/ subpackages
- common/type.go: Add FormatFromType() .
- Renamed common/type_encode.go to common/value_encoder.go .
2020-01-12 18:56:35 -05:00
Dustin Oprea 5c7dc45079 Added all tests for type.go, type_encode.go, parser.go, value_context.go, and utility.go
- Add .MODULE_ROOT anchor file to support testing.
2020-01-12 18:56:35 -05:00
Dustin Oprea bf3bc4e542 Refactor undefined-type tag processing 2020-01-12 18:56:35 -05:00