12 Commits

Author SHA1 Message Date
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 eb5bd13c98801e8d10c570d3b3446248eebc32a5.

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
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
5c21ae7376 ifd_enumerate.go: Enrich unknown-type error with type number 2020-05-16 01:03:31 -04: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
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
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