mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-24 17:06:16 +03:00
Merge branch 'master' into rm-2.7
This commit is contained in:
commit
40133cfc74
|
@ -13,6 +13,7 @@ environment:
|
|||
TEST_OPTIONS:
|
||||
DEPLOY: YES
|
||||
matrix:
|
||||
- PYTHON: C:\Python38rc1-x64
|
||||
- PYTHON: C:/Python37
|
||||
- PYTHON: C:/Python37-x64
|
||||
- PYTHON: C:/Python36
|
||||
|
@ -28,7 +29,6 @@ environment:
|
|||
EXECUTABLE: bin/pypy.exe
|
||||
PIP_DIR: bin
|
||||
VENV: YES
|
||||
- PYTHON: C:\Python38rc1-x64
|
||||
|
||||
|
||||
install:
|
||||
|
|
2
.github/FUNDING.yml
vendored
2
.github/FUNDING.yml
vendored
|
@ -1 +1 @@
|
|||
tidelift: pypi/pillow
|
||||
tidelift: "pypi/Pillow"
|
||||
|
|
2
.github/workflows/macos-install.sh
vendored
2
.github/workflows/macos-install.sh
vendored
|
@ -2,8 +2,6 @@
|
|||
|
||||
set -e
|
||||
|
||||
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
|
||||
|
||||
brew install libtiff libjpeg webp little-cms2
|
||||
|
||||
PYTHONOPTIMIZE=0 pip install cffi
|
||||
|
|
18
.github/workflows/test-windows.yml
vendored
18
.github/workflows/test-windows.yml
vendored
|
@ -58,6 +58,7 @@ jobs:
|
|||
run: |
|
||||
"%pythonLocation%\python.exe" -m pip install wheel pytest pytest-cov
|
||||
pip install codecov
|
||||
shell: cmd
|
||||
|
||||
- name: Fetch dependencies
|
||||
run: |
|
||||
|
@ -96,6 +97,7 @@ jobs:
|
|||
copy /Y /B j*.h %INCLIB%
|
||||
copy /Y /B *.lib %INCLIB%
|
||||
copy /Y /B *.exe %INCLIB%
|
||||
shell: cmd
|
||||
|
||||
- name: Build dependencies / libjpeg-turbo
|
||||
run: |
|
||||
|
@ -114,6 +116,7 @@ jobs:
|
|||
copy /Y /B jpeg-static.lib %INCLIB%\libjpeg.lib
|
||||
copy /Y /B cjpeg-static.exe %INCLIB%\cjpeg.exe
|
||||
copy /Y /B djpeg-static.exe %INCLIB%\djpeg.exe
|
||||
shell: cmd
|
||||
|
||||
- name: Build dependencies / zlib
|
||||
run: |
|
||||
|
@ -128,6 +131,7 @@ jobs:
|
|||
copy /Y /B z*.h %INCLIB%
|
||||
copy /Y /B *.lib %INCLIB%
|
||||
copy /Y /B zlib.lib %INCLIB%\z.lib
|
||||
shell: cmd
|
||||
|
||||
- name: Build dependencies / LibTIFF
|
||||
run: |
|
||||
|
@ -143,6 +147,7 @@ jobs:
|
|||
copy /Y /B libtiff\tiff*.h %INCLIB%
|
||||
copy /Y /B libtiff\*.dll %INCLIB%
|
||||
copy /Y /B libtiff\*.lib %INCLIB%
|
||||
shell: cmd
|
||||
|
||||
- name: Build dependencies / WebP
|
||||
run: |
|
||||
|
@ -157,6 +162,7 @@ jobs:
|
|||
mkdir %INCLIB%\webp
|
||||
copy /Y /B src\webp\*.h %INCLIB%\webp
|
||||
copy /Y /B output\release-static\${{ matrix.architecture }}\lib\* %INCLIB%
|
||||
shell: cmd
|
||||
|
||||
- name: Build dependencies / FreeType
|
||||
run: |
|
||||
|
@ -176,6 +182,7 @@ jobs:
|
|||
%MSBUILD% builds\windows\vc2010\freetype.sln /t:Build /p:Configuration="Release Static" /p:Platform=${{ matrix.platform-msbuild }} /m
|
||||
xcopy /Y /E /Q include %INCLIB%
|
||||
copy /Y /B "objs\${{ matrix.platform-msbuild }}\Release Static\freetype.lib" %INCLIB%
|
||||
shell: cmd
|
||||
|
||||
- name: Build dependencies / LCMS2
|
||||
run: |
|
||||
|
@ -193,6 +200,7 @@ jobs:
|
|||
%MSBUILD% Projects\VC2015\lcms2.sln /t:Clean;lcms2_static /p:Configuration="Release" /p:Platform=${{ matrix.platform-msbuild }} /m
|
||||
xcopy /Y /E /Q include %INCLIB%
|
||||
copy /Y /B Lib\MS\*.lib %INCLIB%
|
||||
shell: cmd
|
||||
|
||||
- name: Build dependencies / OpenJPEG
|
||||
run: |
|
||||
|
@ -211,6 +219,7 @@ jobs:
|
|||
mkdir %INCLIB%\openjpeg-2.3.1
|
||||
copy /Y /B src\lib\openjp2\*.h %INCLIB%\openjpeg-2.3.1
|
||||
copy /Y /B bin\*.lib %INCLIB%
|
||||
shell: cmd
|
||||
|
||||
# GPL licensed; skip if building wheels
|
||||
- name: Build dependencies / libimagequant
|
||||
|
@ -233,6 +242,7 @@ jobs:
|
|||
nmake -nologo -f Makefile
|
||||
copy /Y /B *.h %INCLIB%
|
||||
copy /Y /B *.lib %INCLIB%
|
||||
shell: cmd
|
||||
|
||||
# for Raqm
|
||||
- name: Build dependencies / HarfBuzz
|
||||
|
@ -253,6 +263,7 @@ jobs:
|
|||
nmake -nologo -f Makefile harfbuzz
|
||||
copy /Y /B src\*.h %INCLIB%
|
||||
copy /Y /B *.lib %INCLIB%
|
||||
shell: cmd
|
||||
|
||||
# for Raqm
|
||||
- name: Build dependencies / FriBidi
|
||||
|
@ -272,6 +283,7 @@ jobs:
|
|||
nmake -nologo -f Makefile fribidi
|
||||
copy /Y /B lib\*.h %INCLIB%
|
||||
copy /Y /B *.lib %INCLIB%
|
||||
shell: cmd
|
||||
|
||||
# failing with PyPy3
|
||||
- name: Build dependencies / Raqm
|
||||
|
@ -293,6 +305,7 @@ jobs:
|
|||
nmake -nologo -f Makefile libraqm
|
||||
copy /Y /B src\*.h %INCLIB%
|
||||
copy /Y /B libraqm.dll %INCLIB%
|
||||
shell: cmd
|
||||
|
||||
- name: Build dependencies / ghostscript
|
||||
run: |
|
||||
|
@ -308,6 +321,7 @@ jobs:
|
|||
nmake -nologo -f psi\msvc.mak
|
||||
rem Add bin to PATH variable: Copy to INCLIB, then add INCLIB to PATH in Test step.
|
||||
copy /Y /B bin\* %INCLIB%
|
||||
shell: cmd
|
||||
|
||||
- name: Build Pillow
|
||||
run: |
|
||||
|
@ -323,6 +337,7 @@ jobs:
|
|||
rem Add GhostScript and Raqm binaries (copied to INCLIB) to PATH.
|
||||
path %INCLIB%;%PATH%
|
||||
%PYTHON%\python.exe selftest.py --installed
|
||||
shell: cmd
|
||||
|
||||
- name: Test Pillow
|
||||
run: |
|
||||
|
@ -332,9 +347,11 @@ jobs:
|
|||
path %INCLIB%;%PATH%
|
||||
cd /D %GITHUB_WORKSPACE%
|
||||
%PYTHON%\python.exe -m pytest -vx --cov PIL --cov-report term --cov-report xml Tests
|
||||
shell: cmd
|
||||
|
||||
- name: Upload coverage
|
||||
run: 'codecov --file "%GITHUB_WORKSPACE%\coverage.xml" --name "%pythonLocation%"'
|
||||
shell: cmd
|
||||
|
||||
- name: Build wheel
|
||||
id: wheel
|
||||
|
@ -351,6 +368,7 @@ jobs:
|
|||
set INCLUDE=%INCLIB%;%GITHUB_WORKSPACE%\depends\tcl86\include;%INCLUDE%
|
||||
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" ${{ matrix.platform-vcvars }} 8.1
|
||||
%PYTHON%\python.exe setup.py bdist_wheel
|
||||
shell: cmd
|
||||
|
||||
- uses: actions/upload-artifact@v1
|
||||
if: "github.event_name == 'push' && !contains(matrix.python-version, 'pypy')"
|
||||
|
|
|
@ -18,6 +18,9 @@ matrix:
|
|||
env: LINT="true"
|
||||
- python: "pypy3"
|
||||
name: "PyPy3 Xenial"
|
||||
- python: "3.8"
|
||||
name: "3.8 Xenial"
|
||||
services: xvfb
|
||||
- python: '3.7'
|
||||
name: "3.7 Xenial"
|
||||
services: xvfb
|
||||
|
@ -29,9 +32,6 @@ matrix:
|
|||
name: "3.5 Xenial PYTHONOPTIMIZE=2"
|
||||
env: PYTHONOPTIMIZE=2
|
||||
services: xvfb
|
||||
- python: "3.8-dev"
|
||||
name: "3.8-dev Xenial"
|
||||
services: xvfb
|
||||
- env: DOCKER="alpine" DOCKER_TAG="master"
|
||||
- env: DOCKER="arch" DOCKER_TAG="master" # contains PyQt5
|
||||
- env: DOCKER="ubuntu-16.04-xenial-amd64" DOCKER_TAG="master"
|
||||
|
|
|
@ -3,5 +3,8 @@
|
|||
set -e
|
||||
|
||||
coverage erase
|
||||
if [ $(uname) == "Darwin" ]; then
|
||||
export CPPFLAGS="-I/usr/local/miniconda/include";
|
||||
fi
|
||||
make clean
|
||||
make install-coverage
|
||||
|
|
|
@ -20,11 +20,17 @@ Changelog (Pillow)
|
|||
- Changed default frombuffer raw decoder args #1730
|
||||
[radarhere]
|
||||
|
||||
6.2.0 (2019-10-01)
|
||||
6.2.1 (2019-10-21)
|
||||
------------------
|
||||
|
||||
- This is the last Pillow release to support Python 2.7 #3642
|
||||
|
||||
- Add support for Python 3.8 #4141
|
||||
[hugovk]
|
||||
|
||||
6.2.0 (2019-10-01)
|
||||
------------------
|
||||
|
||||
- Catch buffer overruns #4104
|
||||
[radarhere]
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ Pillow is the friendly PIL fork by `Alex Clark and Contributors <https://github.
|
|||
* - docs
|
||||
- |docs|
|
||||
* - tests
|
||||
- |linux| |macos| |windows| |gha_lint| |gha_docker| |coverage|
|
||||
- |linux| |macos| |windows| |gha_lint| |gha| |gha_windows| |gha_docker| |coverage|
|
||||
* - package
|
||||
- |zenodo| |tidelift| |version| |downloads|
|
||||
* - social
|
||||
|
@ -66,6 +66,12 @@ To report a security vulnerability, please follow the procedure described in the
|
|||
.. |gha_docker| image:: https://github.com/python-pillow/Pillow/workflows/Test%20Docker/badge.svg
|
||||
:alt: GitHub Actions build status (Test Docker)
|
||||
|
||||
.. |gha| image:: https://github.com/python-pillow/Pillow/workflows/Test/badge.svg
|
||||
:alt: GitHub Actions build status (Test Linux and macOS)
|
||||
|
||||
.. |gha_windows| image:: https://github.com/python-pillow/Pillow/workflows/Test%20Windows/badge.svg
|
||||
:alt: GitHub Actions build status (Test Windows)
|
||||
|
||||
.. |coverage| image:: https://codecov.io/gh/python-pillow/Pillow/branch/master/graph/badge.svg
|
||||
:target: https://codecov.io/gh/python-pillow/Pillow
|
||||
:alt: Code coverage
|
||||
|
|
|
@ -51,6 +51,7 @@ Released as needed for security, installation or critical bug fixes.
|
|||
make sdist
|
||||
```
|
||||
* [ ] Create [binary distributions](https://github.com/python-pillow/Pillow/blob/master/RELEASING.md#binary-distributions)
|
||||
* [ ] Upload all binaries and source distributions e.g. `twine upload dist/Pillow-5.2.1*`
|
||||
* [ ] Create a [new release on GitHub](https://github.com/python-pillow/Pillow/releases/new)
|
||||
|
||||
## Embargoed Release
|
||||
|
|
|
@ -51,29 +51,11 @@ def convert_to_comparable(a, b):
|
|||
|
||||
|
||||
class PillowTestCase(unittest.TestCase):
|
||||
def __init__(self, *args, **kwargs):
|
||||
unittest.TestCase.__init__(self, *args, **kwargs)
|
||||
# holds last result object passed to run method:
|
||||
self.currentResult = None
|
||||
|
||||
def run(self, result=None):
|
||||
self.currentResult = result # remember result for use later
|
||||
unittest.TestCase.run(self, result) # call superclass run method
|
||||
|
||||
def delete_tempfile(self, path):
|
||||
try:
|
||||
ok = self.currentResult.wasSuccessful()
|
||||
except AttributeError: # for pytest
|
||||
ok = True
|
||||
|
||||
if ok:
|
||||
# only clean out tempfiles if test passed
|
||||
try:
|
||||
os.remove(path)
|
||||
except OSError:
|
||||
pass # report?
|
||||
else:
|
||||
print("=== orphaned temp file: %s" % path)
|
||||
os.remove(path)
|
||||
except OSError:
|
||||
pass # report?
|
||||
|
||||
def assert_deep_equal(self, a, b, msg=None):
|
||||
try:
|
||||
|
|
|
@ -25,7 +25,7 @@ class PillowQtTestCase:
|
|||
|
||||
class PillowQPixmapTestCase(PillowQtTestCase):
|
||||
def setUp(self):
|
||||
PillowQtTestCase.setUp(self)
|
||||
super().setUp()
|
||||
try:
|
||||
if ImageQt.qt_version == "5":
|
||||
from PyQt5.QtGui import QGuiApplication
|
||||
|
@ -37,7 +37,7 @@ class PillowQPixmapTestCase(PillowQtTestCase):
|
|||
self.app = QGuiApplication([])
|
||||
|
||||
def tearDown(self):
|
||||
PillowQtTestCase.tearDown(self)
|
||||
super().tearDown()
|
||||
self.app.quit()
|
||||
|
||||
|
||||
|
|
|
@ -15,23 +15,25 @@ Notes
|
|||
|
||||
.. note:: Pillow is supported on the following Python versions
|
||||
|
||||
+---------------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+
|
||||
|**Python** |**2.4**|**2.5**|**2.6**|**2.7**|**3.2**|**3.3**|**3.4**|**3.5**|**3.6**|**3.7**|
|
||||
+---------------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+
|
||||
|Pillow < 2.0.0 | Yes | Yes | Yes | Yes | | | | | | |
|
||||
+---------------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+
|
||||
|Pillow 2.x - 3.x | | | Yes | Yes | Yes | Yes | Yes | Yes | | |
|
||||
+---------------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+
|
||||
|Pillow 4.x | | | | Yes | | Yes | Yes | Yes | Yes | |
|
||||
+---------------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+
|
||||
|Pillow 5.0.x - 5.1.x | | | | Yes | | | Yes | Yes | Yes | |
|
||||
+---------------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+
|
||||
|Pillow 5.2.x - 5.4.x | | | | Yes | | | Yes | Yes | Yes | Yes |
|
||||
+---------------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+
|
||||
|Pillow 6.x | | | | Yes | | | | Yes | Yes | Yes |
|
||||
+---------------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+
|
||||
|Pillow >= 7.0.0 | | | | | | | | Yes | Yes | Yes |
|
||||
+---------------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+
|
||||
+-------------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+
|
||||
|**Python** |**2.4**|**2.5**|**2.6**|**2.7**|**3.2**|**3.3**|**3.4**|**3.5**|**3.6**|**3.7**|**3.8**|
|
||||
+-------------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+
|
||||
|Pillow < 2 | Yes | Yes | Yes | Yes | | | | | | | |
|
||||
+-------------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+
|
||||
|Pillow 2 - 3 | | | Yes | Yes | Yes | Yes | Yes | Yes | | | |
|
||||
+-------------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+
|
||||
|Pillow 4 | | | | Yes | | Yes | Yes | Yes | Yes | | |
|
||||
+-------------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+
|
||||
|Pillow 5.0 - 5.1 | | | | Yes | | | Yes | Yes | Yes | | |
|
||||
+-------------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+
|
||||
|Pillow 5.2 - 5.4 | | | | Yes | | | Yes | Yes | Yes | Yes | |
|
||||
+-------------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+
|
||||
|Pillow 6.0 - 6.2.0 | | | | Yes | | | | Yes | Yes | Yes | |
|
||||
+-------------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+
|
||||
|Pillow 6.2.1 | | | | Yes | | | | Yes | Yes | Yes | Yes |
|
||||
+-------------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+
|
||||
|Pillow >= 7 | | | | | | | | Yes | Yes | Yes | Yes |
|
||||
+-------------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+
|
||||
|
||||
Basic Installation
|
||||
------------------
|
||||
|
@ -402,12 +404,12 @@ These platforms are built and tested for every change.
|
|||
+----------------------------------+-------------------------------+-----------------------+
|
||||
| Fedora 30 | 2.7, 3.7 |x86-64 |
|
||||
+----------------------------------+-------------------------------+-----------------------+
|
||||
| macOS 10.13 High Sierra* | 2.7, 3.5, 3.6, 3.7 |x86-64 |
|
||||
| macOS 10.13 High Sierra* | 2.7, 3.5, 3.6, 3.7, 3.8 |x86-64 |
|
||||
+----------------------------------+-------------------------------+-----------------------+
|
||||
| Ubuntu Linux 16.04 LTS | 2.7, 3.5, 3.6, 3.7, |x86-64 |
|
||||
| Ubuntu Linux 16.04 LTS | 2.7, 3.5, 3.6, 3.7, 3.8, |x86-64 |
|
||||
| | PyPy, PyPy3 | |
|
||||
+----------------------------------+-------------------------------+-----------------------+
|
||||
| Windows Server 2012 R2 | 2.7, 3.5, 3.6, 3.7 |x86, x86-64 |
|
||||
| Windows Server 2012 R2 | 2.7, 3.5, 3.6, 3.7, 3.8 |x86, x86-64 |
|
||||
| +-------------------------------+-----------------------+
|
||||
| | PyPy, 3.7/MinGW |x86 |
|
||||
+----------------------------------+-------------------------------+-----------------------+
|
||||
|
|
|
@ -62,14 +62,6 @@ shared instance of ``Image.Exif``.
|
|||
Deprecations
|
||||
^^^^^^^^^^^^
|
||||
|
||||
Python 2.7
|
||||
~~~~~~~~~~
|
||||
|
||||
Python 2.7 reaches end-of-life on 2020-01-01.
|
||||
|
||||
Pillow 7.0.0 will be released on 2020-01-01 and will drop support for Python
|
||||
2.7, making Pillow 6.2.x the last release series to support Python 2.
|
||||
|
||||
Image.frombuffer
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
|
|
26
docs/releasenotes/6.2.1.rst
Normal file
26
docs/releasenotes/6.2.1.rst
Normal file
|
@ -0,0 +1,26 @@
|
|||
6.2.1
|
||||
-----
|
||||
|
||||
API Changes
|
||||
===========
|
||||
|
||||
Deprecations
|
||||
^^^^^^^^^^^^
|
||||
|
||||
Python 2.7
|
||||
~~~~~~~~~~
|
||||
|
||||
Python 2.7 reaches end-of-life on 2020-01-01.
|
||||
|
||||
Pillow 7.0.0 will be released on 2020-01-01 and will drop support for Python
|
||||
2.7, making Pillow 6.2.x the last release series to support Python 2.
|
||||
|
||||
Other Changes
|
||||
=============
|
||||
|
||||
|
||||
|
||||
Support added for Python 3.8
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Pillow 6.2.1 supports Python 3.8.
|
|
@ -6,6 +6,7 @@ Release Notes
|
|||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
6.2.1
|
||||
6.2.0
|
||||
6.1.0
|
||||
6.0.0
|
||||
|
|
3
setup.py
3
setup.py
|
@ -19,7 +19,7 @@ from distutils.command.build_ext import build_ext
|
|||
|
||||
from setuptools import Extension, setup
|
||||
|
||||
if sys.platform == "win32" and sys.version_info >= (3, 8):
|
||||
if sys.platform == "win32" and sys.version_info >= (3, 9):
|
||||
warnings.warn(
|
||||
"Pillow does not yet support Python {}.{} and does not yet provide "
|
||||
"prebuilt Windows binaries. We do not recommend building from "
|
||||
|
@ -862,6 +862,7 @@ try:
|
|||
"Programming Language :: Python :: 3.5",
|
||||
"Programming Language :: Python :: 3.6",
|
||||
"Programming Language :: Python :: 3.7",
|
||||
"Programming Language :: Python :: 3.8",
|
||||
"Programming Language :: Python :: 3 :: Only",
|
||||
"Programming Language :: Python :: Implementation :: CPython",
|
||||
"Programming Language :: Python :: Implementation :: PyPy",
|
||||
|
|
|
@ -84,8 +84,7 @@ def bdf_char(f):
|
|||
|
||||
class BdfFontFile(FontFile.FontFile):
|
||||
def __init__(self, fp):
|
||||
|
||||
FontFile.FontFile.__init__(self)
|
||||
super().__init__()
|
||||
|
||||
s = fp.readline()
|
||||
if s[:13] != b"STARTFONT 2.1":
|
||||
|
|
|
@ -78,7 +78,7 @@ class ImageFile(Image.Image):
|
|||
"Base class for image file format handlers."
|
||||
|
||||
def __init__(self, fp=None, filename=None):
|
||||
Image.Image.__init__(self)
|
||||
super().__init__()
|
||||
|
||||
self._min_frame = 0
|
||||
|
||||
|
|
|
@ -173,8 +173,7 @@ if qt_is_installed:
|
|||
# buffer, so this buffer has to hang on for the life of the image.
|
||||
# Fixes https://github.com/python-pillow/Pillow/issues/1370
|
||||
self.__data = im_data["data"]
|
||||
QImage.__init__(
|
||||
self,
|
||||
super().__init__(
|
||||
self.__data,
|
||||
im_data["im"].size[0],
|
||||
im_data["im"].size[1],
|
||||
|
|
|
@ -290,7 +290,7 @@ def _show(image, title):
|
|||
self.image = BitmapImage(im, foreground="white", master=master)
|
||||
else:
|
||||
self.image = PhotoImage(im, master=master)
|
||||
tkinter.Label.__init__(self, master, image=self.image, bg="black", bd=0)
|
||||
super().__init__(master, image=self.image, bg="black", bd=0)
|
||||
|
||||
if not tkinter._default_root:
|
||||
raise OSError("tkinter not initialized")
|
||||
|
|
|
@ -224,7 +224,7 @@ class ImageWindow(Window):
|
|||
image = Dib(image)
|
||||
self.image = image
|
||||
width, height = image.size
|
||||
Window.__init__(self, title, width=width, height=height)
|
||||
super().__init__(title, width=width, height=height)
|
||||
|
||||
def ui_handle_repair(self, dc, x0, y0, x1, y1):
|
||||
self.image.draw(dc, (x0, y0, x1, y1))
|
||||
|
|
|
@ -62,7 +62,7 @@ class PcfFontFile(FontFile.FontFile):
|
|||
if magic != PCF_MAGIC:
|
||||
raise SyntaxError("not a PCF file")
|
||||
|
||||
FontFile.FontFile.__init__(self)
|
||||
super().__init__()
|
||||
|
||||
count = l32(fp.read(4))
|
||||
self.toc = {}
|
||||
|
|
|
@ -292,8 +292,7 @@ class PngInfo:
|
|||
|
||||
class PngStream(ChunkStream):
|
||||
def __init__(self, fp):
|
||||
|
||||
ChunkStream.__init__(self, fp)
|
||||
super().__init__(fp)
|
||||
|
||||
# local copies of Image attributes
|
||||
self.im_info = {}
|
||||
|
|
|
@ -54,7 +54,7 @@ class TarIO(ContainerIO.ContainerIO):
|
|||
self.fh.seek((size + 511) & (~511), io.SEEK_CUR)
|
||||
|
||||
# Open region
|
||||
ContainerIO.ContainerIO.__init__(self, self.fh, self.fh.tell(), size)
|
||||
super().__init__(self.fh, self.fh.tell(), size)
|
||||
|
||||
# Context manager support
|
||||
def __enter__(self):
|
||||
|
|
|
@ -884,7 +884,7 @@ class ImageFileDirectory_v1(ImageFileDirectory_v2):
|
|||
"""
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
ImageFileDirectory_v2.__init__(self, *args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
self._legacy_api = True
|
||||
|
||||
tags = property(lambda self: self._tags_v1)
|
||||
|
|
Loading…
Reference in New Issue
Block a user