-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Support creating BGR;15, BGR;16 and BGR;24 images, but drop support for BGR;32 #7010
Changes from all commits
9e6ae98
01cdfb6
11d100c
a236c27
d5d830d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -353,8 +353,8 @@ def test_p_putpixel_rgb_rgba(self, mode): | |
|
||
|
||
class TestImagePutPixelError(AccessTest): | ||
IMAGE_MODES1 = ["L", "LA", "RGB", "RGBA"] | ||
IMAGE_MODES2 = ["I", "I;16", "BGR;15"] | ||
IMAGE_MODES1 = ["LA", "RGB", "RGBA", "BGR;15"] | ||
IMAGE_MODES2 = ["L", "I", "I;16"] | ||
INVALID_TYPES = ["foo", 1.0, None] | ||
|
||
@pytest.mark.parametrize("mode", IMAGE_MODES1) | ||
|
@@ -369,6 +369,11 @@ def test_putpixel_type_error1(self, mode): | |
( | ||
("L", (0, 2), "color must be int or single-element tuple"), | ||
("LA", (0, 3), "color must be int, or tuple of one or two elements"), | ||
( | ||
"BGR;15", | ||
(0, 2), | ||
"color must be int, or tuple of one or three elements", | ||
), | ||
( | ||
"RGB", | ||
(0, 2, 5), | ||
|
@@ -397,11 +402,6 @@ def test_putpixel_overflow_error(self, mode): | |
with pytest.raises(OverflowError): | ||
im.putpixel((0, 0), 2**80) | ||
|
||
def test_putpixel_unrecognized_mode(self): | ||
im = hopper("BGR;15") | ||
with pytest.raises(ValueError, match="unrecognized image mode"): | ||
im.putpixel((0, 0), 0) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This error came from converting an image to a mode that The error should still be in C in case we break something in the future, but I don't think it can be tested. |
||
|
||
|
||
class TestEmbeddable: | ||
@pytest.mark.xfail(reason="failing test") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Later in this file,
IMAGE_MODES2
are tested to raise "color must be int or single-element tuple", whileIMAGE_MODES1
are tested to raise "color must be int or tuple". This makes sense, as allIMAGE_MODES2
are single channel, whileIMAGE_MODES1
have multiple channels.