Skip to content

Port GifControlDirectory additions from Java #181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 18, 2019
Merged

Port GifControlDirectory additions from Java #181

merged 2 commits into from
Jul 18, 2019

Conversation

kwhopper
Copy link
Collaborator

Todo: backport GifControlDescriptor "{value}" addition to Java
Todo: backport to Java GifReader -- directory.Set(GifControlDirectory.TagUserInputFlag, (packedFields & 2) == 2);


if (blockSizeBytes > 3)
reader.Skip(blockSizeBytes - 3);
directory.Set(GifControlDirectory.TagTransparentColorIndex, reader.GetByte());
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This used to sometimes skip three bytes, but now always consumes only one. Is this correct?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know for sure without further investigation. This was ported directly from the Java version approved through drewnoakes/metadata-extractor#241.

Maybe @Nadahar has some info on it?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry, I checked in my memory, but I'm unable to revive any information about this. From what I can see from the PR, additional parsing was added. It doesn't seem unreasonable that less will be skipped when more is parsed.. does this behavior cause a problem?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

additional parsing was added

It's just unpacking a single byte that was previously skipped.

@kwhopper if you're happy that your testing produced better results with this change then I'm happy.

Copy link
Collaborator Author

@kwhopper kwhopper Jul 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears to produce the same results as the Java implementation against the image repository. To me, that's the best we can reasonably expect when porting.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for confirming. Merged!

@drewnoakes drewnoakes merged commit 2f446ce into drewnoakes:master Jul 18, 2019
@drewnoakes
Copy link
Owner

Todo: backport GifControlDescriptor "{value}" addition to Java
Todo: backport to Java GifReader -- directory.Set(GifControlDirectory.TagUserInputFlag, (packedFields & 2) == 2);

Could you open issue for these two please so they're not lost?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants