Implement issue #232 #91
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First try at (most of) drewnoakes/metadata-extractor#232
Consider this ALPHA; I'd really like a lot of feedback before you/we integrate this PR. There is some commented-code I want to keep in there until some review is done.
The main change is obviously no more byte arrays in a jpegsegment. Instead, the absolute location values are stored as @drewnoakes implemented in ShowJpegStructure with a few updates. This implied that two passes would be required, at least in this implementation. The first pass records the segments, the second pass extracts the metadata expecting a reference to the original still-open Stream.
JpegSegmentReader has some notable changes and most are self-explanatory. One relates to drewnoakes/metadata-extractor#234 and processing beyond the first Sos marker. I decided to leave multiple SOS processing in there for this PR, but ultimately I think it should be removed and put the "yield break;" back (it's commented out). ExifTool says that metadata stops after Sos is reached. I tend to agree; DHT data feels outside the scope of this library. But that's certainly open to debate.
Let me know what you guys want to do, and please look over the code if you get some time.