Skip to content
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

Horiz/Vert sampling factors reversed? #152

Closed
drewnoakes opened this issue Feb 28, 2016 · 2 comments
Closed

Horiz/Vert sampling factors reversed? #152

drewnoakes opened this issue Feb 28, 2016 · 2 comments

Comments

@drewnoakes
Copy link
Owner

Suresh said on the mailing list:

I found an issue with the JPEG sampling factors extracted by your library. I found the Horizontal and Vertical sampling factors switched (1,2 instead of 2,1) when I compared it with the information provided by JPEGTRAN.

I have attached a zip file with a sample program, a sample image and the jpegtran command I used to compare check the sampling factor.

Is it just an issue of switching of the 2 fields or is there some other bug? After finding this issue I am using a jpegtran crop command just to get this info which will make my date stamping a little bit slower.

Here is the ZIP file: sampling_factor.zip

@kwhopper
Copy link
Collaborator

They appear to be reversed. All you have to do is swap the method bodies in JpegComponent.java for getHorizontalSamplingFactor() and getVerticalSamplingFactor(). This is confirmed with ExifTool and metadata-extractor-dotnet testing.

@drewnoakes
Copy link
Owner Author

Closed via #156.

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

No branches or pull requests

2 participants