mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-11 04:07:21 +03:00
Merge pull request #4689 from radarhere/qt
Removed ImageQt workaround for earlier versions
This commit is contained in:
commit
41a75210b5
|
@ -142,12 +142,7 @@ def _toqclass_helper(im):
|
||||||
data = im.tobytes("raw", "BGRX")
|
data = im.tobytes("raw", "BGRX")
|
||||||
format = QImage.Format_RGB32
|
format = QImage.Format_RGB32
|
||||||
elif im.mode == "RGBA":
|
elif im.mode == "RGBA":
|
||||||
try:
|
data = im.tobytes("raw", "BGRA")
|
||||||
data = im.tobytes("raw", "BGRA")
|
|
||||||
except SystemError:
|
|
||||||
# workaround for earlier versions
|
|
||||||
r, g, b, a = im.split()
|
|
||||||
im = Image.merge("RGBA", (b, g, r, a))
|
|
||||||
format = QImage.Format_ARGB32
|
format = QImage.Format_ARGB32
|
||||||
else:
|
else:
|
||||||
raise ValueError("unsupported image mode %r" % im.mode)
|
raise ValueError("unsupported image mode %r" % im.mode)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user