mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-27 10:26:19 +03:00
Merge pull request #5775 from hugovk/mingw-qt6
This commit is contained in:
commit
b4bd8943fa
2
.github/workflows/test-mingw.yml
vendored
2
.github/workflows/test-mingw.yml
vendored
|
@ -42,7 +42,7 @@ jobs:
|
||||||
${{ matrix.package }}-python3-numpy \
|
${{ matrix.package }}-python3-numpy \
|
||||||
${{ matrix.package }}-python3-olefile \
|
${{ matrix.package }}-python3-olefile \
|
||||||
${{ matrix.package }}-python3-pip \
|
${{ matrix.package }}-python3-pip \
|
||||||
${{ matrix.package }}-python3-pyqt5 \
|
${{ matrix.package }}-python-pyqt6 \
|
||||||
${{ matrix.package }}-python3-setuptools \
|
${{ matrix.package }}-python3-setuptools \
|
||||||
${{ matrix.package }}-freetype \
|
${{ matrix.package }}-freetype \
|
||||||
${{ matrix.package }}-ghostscript \
|
${{ matrix.package }}-ghostscript \
|
||||||
|
|
|
@ -66,7 +66,13 @@ def fromqimage(im):
|
||||||
:param im: QImage or PIL ImageQt object
|
:param im: QImage or PIL ImageQt object
|
||||||
"""
|
"""
|
||||||
buffer = QBuffer()
|
buffer = QBuffer()
|
||||||
qt_openmode = QIODevice.OpenMode if qt_version == "6" else QIODevice
|
if qt_version == "6":
|
||||||
|
try:
|
||||||
|
qt_openmode = QIODevice.OpenModeFlag
|
||||||
|
except AttributeError:
|
||||||
|
qt_openmode = QIODevice.OpenMode
|
||||||
|
else:
|
||||||
|
qt_openmode = QIODevice
|
||||||
buffer.open(qt_openmode.ReadWrite)
|
buffer.open(qt_openmode.ReadWrite)
|
||||||
# preserve alpha channel with png
|
# preserve alpha channel with png
|
||||||
# otherwise ppm is more friendly with Image.open
|
# otherwise ppm is more friendly with Image.open
|
||||||
|
|
Loading…
Reference in New Issue
Block a user