Commit Graph

204 Commits (903910b6a7ce4165fe935d413d3e0edd2fcea947)

Author SHA1 Message Date
Dustin Oprea e8c30b7811 Tweaked write to-dos. 2018-05-01 10:20:39 -04:00
Dustin Oprea 98620a7d84 exif: Added function descriptions. 2018-05-01 10:18:52 -04:00
Dustin Oprea 2fca65a8ea ifd_builder_encoder: Added method to package full EXIF.
- Moved the EXIF-parsing being done in the tests to reusable code.
2018-05-01 03:29:42 -04:00
Dustin Oprea 9c721a573d ifd_builder_encode: Added test for recursive IB encoder.
- Constructs full structured EXIF on-disk structure.
- Bugfix: EncodeToBytes() started from an incorrect, initial offset.
2018-05-01 03:07:33 -04:00
Dustin Oprea 3a20f12306 encodeAndAttachIfd: Corrected IFD chain allocation arithmetic. 2018-04-30 03:30:34 -04:00
Dustin Oprea fe20d2c334 ifd_buider_encode: Fixed test.
- Because of addressing bugfix.
2018-04-30 02:40:41 -04:00
Dustin Oprea c83ebaf2a7 ifd_builder_encode: Added test to build and parse an EXIF.
- A big milestone. This is the same parsing that already works with
  EXIFs from production JPEGs.
2018-04-30 02:34:24 -04:00
Dustin Oprea 6ffca34f8e ifd_tag_entry: Implemented Value() and ValueString() wrappers.
- type: Added `(TagType).Resolve()` to return the parsed, typed value.
2018-04-30 02:32:08 -04:00
Dustin Oprea 89cfa38cfc exif: Reorganized. No-op changes. 2018-04-30 01:33:13 -04:00
Dustin Oprea db33894cde unknown: Moved UnknownValue() to type.go . 2018-04-30 01:32:09 -04:00
Dustin Oprea 81079a77d6 exif: Added EXIF header builder and unit-test. 2018-04-29 02:48:52 -04:00
Dustin Oprea bbc7f976af ifd_builder: Added test for encoding a complete IFD. 2018-04-29 01:51:12 -04:00
Dustin Oprea 4d0cfdc1d4 ifd_builder_encode: Added test for value allocation. 2018-04-29 00:41:07 -04:00
Dustin Oprea 9e8b57992d ifb_builder_encode: Tweaked comments and naming in test. 2018-04-28 22:39:05 -04:00
Dustin Oprea 18d527eb72 ifd_builder_encode: Added tests for child-IFD encoding and allocation.
- ifd_enumerate: Added utility functions to parse individual, encoded
  IFDs and tags.
- ifd_builder: Corrected `NewBuilderTagFromConfig()` to automatically
  encode whichever type of value-argument it gets.
2018-04-28 19:22:13 -04:00
Dustin Oprea 9db558a82d ifd_enumerate: Moved tag-parsing to separate method. 2018-04-28 13:08:15 -04:00
Dustin Oprea d06a3c8963 ifd_builder: Implemented NewBuilderTagFromConfig() BT factory for testing.
- Updated IfdByteEncoder tests to use it instead of hacking-together
  their own BT's (makes for more standardized, consistent testing).

- Universally refactored all core IFD knowledge implemented upon a
  single IFD name to instead work with IfdIdentity instances, instead,
  in order to validate that we only recognize the IFDs only in the
  context of the correct parents in the hierarchy.

- Implemented standard testing byte-order (assigned to
  TestDefaultByteOrder).
2018-04-27 03:42:59 -04:00
Dustin Oprea a23c437e5e type_decode: Switch unknown-type processor to read as ACII-non-nul.
- This is the type that we're officially using so this is how we should
  be parsing it.
2018-04-25 15:14:33 -04:00
Dustin Oprea 395c67bd57 ifd_builder: Tweaked TO-DOs. 2018-04-25 11:56:51 -04:00
Dustin Oprea 383780b3d8 ifd_builder_encode: Began writing tests. Began with encodeTagToBytes. More tests to go. 2018-04-25 11:51:08 -04:00
Dustin Oprea cabbc2fca1 ifd_builder: Added tests for ancillary builder logic. 2018-04-25 04:32:58 -04:00
Dustin Oprea 04631a36c3 ifd_builder: Wrote encoding and allocation logic.
- All of the major design considerations have been covered (unless we
  overlooked something).

- Completely untested.
2018-04-24 05:12:30 -04:00
Dustin Oprea d035d20098 ifd_builder: value is now guaranteed to be a byte-slice or child-IFD.
- Using an interface{} required us to validate the encapsulated type or
  risk forgetting to.

- AddTagsFromExisting now just copies the bytes verbatim if no value-
  resolver provided.
2018-04-23 23:58:37 -04:00
Dustin Oprea 098862d2f9 ifd_builder: Added NewIfdBuilderWithExistingIfd test. 2018-04-23 22:07:13 -04:00
Dustin Oprea 1107496d3c ifd_builder: AddChildIb now validates not previously added. 2018-04-23 21:59:42 -04:00
Dustin Oprea 4bea09dc78 ifd_builder: Can now build a complete chain from existing EXIF.
- ifd_builder:
  - We now validate that `builderTag` instances are either a byte array
    or a child Ifd before allowing to add.
  - Renamed `builderTag.valueBytes` to `builderTag.value` (it's not
    necessarily bytes).
  - `builderTag` now gets the child IFD name if representing a child
    IFD.
  - Added ability to dump structure to string slice.
  - Added NewIfdBuilderFromExistingChain to reconstruct whole chain
    from a read IFD chain (collection).
  - Wrote IB dumper.
  - Added structural tests.
  - Moved ifd_tag_entry types to separate file.

- tags_unknown: Unknown-type tags can now satisfy the `UnknownTagValue`
interface to return `[]byte`.
  - `IfdTagEntry.ValueBytes` automatically uses this. Else, error if not
    `[]byte` or `string`.

- ifd_enumerate
  - Now embed `ByteOrder` in `Ifd` (we otherwise require it to be passed
    a bit too often).

- Renamed some occurences of "IFD" to "IB" where an actual IB in order
  to not be confusing.
2018-04-23 04:53:51 -04:00
Dustin Oprea 50eafa98d6 ifd_enumerate: Added tests.
- Refactored (IfdTagEntry).ValueBytes() to handle managed undefined
  values.
2018-04-22 02:35:33 -04:00
Dustin Oprea f1f23dca82 General intuitivity refactor. Imp'd (IfdTagEntry).ValueBytes().
- Added some assertions and constants. Renamed from variable so it'd be easy to
  tell if the byte-arrays, even though they come directly from the EXIF, which
  specific offsets they start at (so no remove for confusion during enumeration
  and building).
2018-04-21 20:54:56 -04:00
Dustin Oprea ff7cfacd60 type_decode: Attempted and commented decoding MakerNote as EXIF. 2018-04-21 11:32:27 -04:00
Dustin Oprea 67a5e1f548 tags: Now read types.
- Required as the source-of-truth for writing.
2018-04-21 11:17:34 -04:00
Dustin Oprea a909226514 type_decode: Implemented immediate remaining 'unknown'-type tags.
- Except for MakerNote. We're just going to have to skip that when
  writing, for now.
2018-04-21 03:40:33 -04:00
Dustin Oprea 00a5a5ad5b ifd_builder: Fixed so will compile. 2018-04-21 00:24:54 -04:00
Dustin Oprea 83c4834547 ifd_builder: Renamings. 2018-04-20 11:54:42 -04:00
Dustin Oprea d4740ae5b5 Added TODOs. 2018-04-20 11:52:06 -04:00
Dustin Oprea 88333d9088 ifd_builder: Added main flow and allocation.
- We still need to implement the size calculations and tag encoding.
2018-04-20 11:45:32 -04:00
Dustin Oprea f9267550eb ifd_builder: Added renaming tests. 2018-04-20 04:16:48 -04:00
Dustin Oprea b5299427bc ifd_builder: Added tests for creating and adding. 2018-04-19 04:04:19 -04:00
Dustin Oprea f99faad160 builder: Added full IFD-building functionality.
- There are still some placeholders for things that we need to figure
  out.

- Still needs tests.
2018-04-19 02:43:17 -04:00
Dustin Oprea 52dafd070a collect: Added a massive test for collected structure. 2018-04-19 01:02:03 -04:00
Dustin Oprea 679ea19d6c ifd_enumerate. The IFD tree and content can now be collected.
- Collected into a static structure in addition to scanned (which is
- only a visitor pattern).
- Test still has be finished.
2018-04-18 07:58:05 -04:00
Dustin Oprea acbda6d1e1 ifd_enumerate: Refactored for reusability from a collector loop. 2018-04-18 06:28:12 -04:00
Dustin Oprea 33e3f2e4eb ifd: Renamed Ifd to IfdEnumerate. 2018-04-17 07:51:34 -04:00
Dustin Oprea 917e288adf Refactored byte-ordering to use standard binary.ByteOrder .
- ..rather than unnecessary custom implementation.
2018-04-17 06:18:31 -04:00
Dustin Oprea 53f74d18a1 type: Added encoding and complete encode/parse tests. 2018-04-17 06:06:51 -04:00
Dustin Oprea 5864c10c03 Added TODO items with writing objectives. 2018-04-16 03:40:30 -04:00
Dustin Oprea f1521d4bac documentation: Added documentation and reader-tool for testing. 2018-04-16 01:57:30 -04:00
Dustin Oprea 42e678f6c2 type: Implemented workflow for undefined-type tags.
- Implemented for the straightforward tags. Noted what had to be done
  for the rest.
2018-04-16 00:30:39 -04:00
Dustin Oprea 172013e0f0 ifd: Implemented recursion. Refactored IFD seeking.
- tags.yaml: Uncommented previously-unhandleable tags.
2018-04-15 23:13:25 -04:00
Dustin Oprea 34fb63841d tags: Now use iterative YAML parser. 2018-04-15 20:16:32 -04:00
Dustin Oprea a7bf17d299 assets: Updated tags.
- Wrote tool to produce complete knowledge of tags.
2018-04-15 13:40:24 -04:00