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

Valid range for baseline jpeg qtables 0 to 255 #1814

Merged
merged 2 commits into from Apr 19, 2016

Conversation

thebostik
Copy link
Contributor

fixed issue from using signed char instead of unsigned char. added test

…g signed char instead of unsigned char. added test
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling b38c32e on thebostik:jpeg-qtable-bounds into * on python-pillow:master*.

…sing signed char instead of unsigned char. added test
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 5025bdd on thebostik:jpeg-qtable-bounds into * on python-pillow:master*.

@@ -314,6 +314,10 @@ def test_qtables(self):
30)
self.assert_image_similar(im, self.roundtrip(im, qtables='keep'), 30)

# valid bounds for baseline qtable
bounds_qtable = [int(s) for s in ("255 1 " * 32).split(None)]
Copy link
Member

@wiredfool wiredfool Apr 19, 2016

Choose a reason for hiding this comment

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

bounds_qtable = [ 255, 1] *32 seems far clearer.

on the other hand, that is what the rest of them look like...

@wiredfool wiredfool merged commit ae6c46e into python-pillow:master Apr 19, 2016
thebostik added a commit to thebostik/Pillow that referenced this pull request May 23, 2016
And there was a lingering bug since the previous qtable unsigned char fix
(python-pillow#1814) since the call to array.array was in another place, the roundtrip was no
longer equivalent.

That was a minor change, but the revised test wouldn't pass because saving an image
with one custom qtable automatically adds a second to it by the call to
jpeg_set_defaults.
With 1 or >2 custom tables, there is extra work we have to do due to that call.
Fahad-Alsaidi pushed a commit to Fahad-Alsaidi/Pillow that referenced this pull request Dec 13, 2016
And there was a lingering bug since the previous qtable unsigned char fix
(python-pillow#1814) since the call to array.array was in another place, the roundtrip was no
longer equivalent.

That was a minor change, but the revised test wouldn't pass because saving an image
with one custom qtable automatically adds a second to it by the call to
jpeg_set_defaults.
With 1 or >2 custom tables, there is extra work we have to do due to that call.
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.

None yet

3 participants