mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-26 09:14:27 +03:00
And now for something completely different. Py3 compatibility
This commit is contained in:
parent
67c235b7c0
commit
e14e3593d9
|
@ -65,8 +65,10 @@ class TestFormatHSV(PillowTestCase):
|
||||||
converted = [self.tuple_to_ints(func(conv_func(_r), conv_func(_g), conv_func(_b)))
|
converted = [self.tuple_to_ints(func(conv_func(_r), conv_func(_g), conv_func(_b)))
|
||||||
for (_r, _g, _b) in iter_helper(r.tobytes(), g.tobytes(), b.tobytes())]
|
for (_r, _g, _b) in iter_helper(r.tobytes(), g.tobytes(), b.tobytes())]
|
||||||
|
|
||||||
|
if str is bytes:
|
||||||
new_bytes = b''.join(chr(h)+chr(s)+chr(v) for (h,s,v) in converted)
|
new_bytes = b''.join(chr(h)+chr(s)+chr(v) for (h,s,v) in converted)
|
||||||
|
else:
|
||||||
|
new_bytes = b''.join(bytes(chr(h)+chr(s)+chr(v), 'latin-1') for (h,s,v) in converted)
|
||||||
|
|
||||||
hsv = Image.frombytes(mode,r.size, new_bytes)
|
hsv = Image.frombytes(mode,r.size, new_bytes)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user