Merge remote-tracking branch 'upstream/master' into rm-2.7

This commit is contained in:
Hugo 2019-11-18 13:56:42 +02:00
commit e5486b40f8
40 changed files with 80 additions and 181 deletions

View File

@ -349,6 +349,13 @@ jobs:
%PYTHON%\python.exe -m pytest -vx --cov PIL --cov-report term --cov-report xml Tests
shell: cmd
- name: Upload errors
uses: actions/upload-artifact@v1
if: failure()
with:
name: errors
path: Tests/errors
- name: Upload coverage
run: 'codecov --file "%GITHUB_WORKSPACE%\coverage.xml" --name "%pythonLocation%"'
shell: cmd

View File

@ -53,6 +53,13 @@ jobs:
run: |
.travis/test.sh
- name: Upload errors
uses: actions/upload-artifact@v1
if: failure()
with:
name: errors
path: Tests/errors
- name: Docs
if: matrix.python-version == 3.8
run: |

View File

@ -22,12 +22,26 @@ if os.environ.get("SHOW_ERRORS", None):
HAS_UPLOADER = True
class test_image_results:
@classmethod
def upload(self, a, b):
@staticmethod
def upload(a, b):
a.show()
b.show()
elif "GITHUB_ACTIONS" in os.environ:
HAS_UPLOADER = True
class test_image_results:
@staticmethod
def upload(a, b):
dir_errors = os.path.join(os.path.dirname(__file__), "errors")
os.makedirs(dir_errors, exist_ok=True)
tmpdir = tempfile.mkdtemp(dir=dir_errors)
a.save(os.path.join(tmpdir, "a.png"))
b.save(os.path.join(tmpdir, "b.png"))
return tmpdir
else:
try:
import test_image_results

View File

@ -22,31 +22,6 @@ 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.x the last series to support Python 2.
PIL.*ImagePlugin.__version__ attributes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. deprecated:: 6.0.0
The version constants of individual plugins have been deprecated and will be removed in
a future version. Use ``PIL.__version__`` instead.
=============================== ================================= ==================================
Deprecated Deprecated Deprecated
=============================== ================================= ==================================
``BmpImagePlugin.__version__`` ``Jpeg2KImagePlugin.__version__`` ``PngImagePlugin.__version__``
``CurImagePlugin.__version__`` ``JpegImagePlugin.__version__`` ``PpmImagePlugin.__version__``
``DcxImagePlugin.__version__`` ``McIdasImagePlugin.__version__`` ``PsdImagePlugin.__version__``
``EpsImagePlugin.__version__`` ``MicImagePlugin.__version__`` ``SgiImagePlugin.__version__``
``FliImagePlugin.__version__`` ``MpegImagePlugin.__version__`` ``SunImagePlugin.__version__``
``FpxImagePlugin.__version__`` ``MpoImagePlugin.__version__`` ``TgaImagePlugin.__version__``
``GdImageFile.__version__`` ``MspImagePlugin.__version__`` ``TiffImagePlugin.__version__``
``GifImagePlugin.__version__`` ``PalmImagePlugin.__version__`` ``WmfImagePlugin.__version__``
``IcoImagePlugin.__version__`` ``PcdImagePlugin.__version__`` ``XbmImagePlugin.__version__``
``ImImagePlugin.__version__`` ``PcxImagePlugin.__version__`` ``XpmImagePlugin.__version__``
``ImtImagePlugin.__version__`` ``PdfImagePlugin.__version__`` ``XVThumbImagePlugin.__version__``
``IptcImagePlugin.__version__`` ``PixarImagePlugin.__version__``
=============================== ================================= ==================================
ImageCms.CmsProfile attributes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -103,6 +78,31 @@ PILLOW_VERSION constant
``PILLOW_VERSION`` has been removed. Use ``__version__`` instead.
PIL.*ImagePlugin.__version__ attributes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*Removed in version 7.0.0.*
The version constants of individual plugins have been removed. Use ``PIL.__version__``
instead.
=============================== ================================= ==================================
Removed Removed Removed
=============================== ================================= ==================================
``BmpImagePlugin.__version__`` ``Jpeg2KImagePlugin.__version__`` ``PngImagePlugin.__version__``
``CurImagePlugin.__version__`` ``JpegImagePlugin.__version__`` ``PpmImagePlugin.__version__``
``DcxImagePlugin.__version__`` ``McIdasImagePlugin.__version__`` ``PsdImagePlugin.__version__``
``EpsImagePlugin.__version__`` ``MicImagePlugin.__version__`` ``SgiImagePlugin.__version__``
``FliImagePlugin.__version__`` ``MpegImagePlugin.__version__`` ``SunImagePlugin.__version__``
``FpxImagePlugin.__version__`` ``MpoImagePlugin.__version__`` ``TgaImagePlugin.__version__``
``GdImageFile.__version__`` ``MspImagePlugin.__version__`` ``TiffImagePlugin.__version__``
``GifImagePlugin.__version__`` ``PalmImagePlugin.__version__`` ``WmfImagePlugin.__version__``
``IcoImagePlugin.__version__`` ``PcdImagePlugin.__version__`` ``XbmImagePlugin.__version__``
``ImImagePlugin.__version__`` ``PcxImagePlugin.__version__`` ``XpmImagePlugin.__version__``
``ImtImagePlugin.__version__`` ``PdfImagePlugin.__version__`` ``XVThumbImagePlugin.__version__``
``IptcImagePlugin.__version__`` ``PixarImagePlugin.__version__``
=============================== ================================= ==================================
PyQt4 and PySide
~~~~~~~~~~~~~~~~

View File

@ -9,6 +9,29 @@ PILLOW_VERSION constant
``PILLOW_VERSION`` has been removed. Use ``__version__`` instead.
PIL.*ImagePlugin.__version__ attributes
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The version constants of individual plugins have been removed. Use ``PIL.__version__``
instead.
=============================== ================================= ==================================
Removed Removed Removed
=============================== ================================= ==================================
``BmpImagePlugin.__version__`` ``Jpeg2KImagePlugin.__version__`` ``PngImagePlugin.__version__``
``CurImagePlugin.__version__`` ``JpegImagePlugin.__version__`` ``PpmImagePlugin.__version__``
``DcxImagePlugin.__version__`` ``McIdasImagePlugin.__version__`` ``PsdImagePlugin.__version__``
``EpsImagePlugin.__version__`` ``MicImagePlugin.__version__`` ``SgiImagePlugin.__version__``
``FliImagePlugin.__version__`` ``MpegImagePlugin.__version__`` ``SunImagePlugin.__version__``
``FpxImagePlugin.__version__`` ``MpoImagePlugin.__version__`` ``TgaImagePlugin.__version__``
``GdImageFile.__version__`` ``MspImagePlugin.__version__`` ``TiffImagePlugin.__version__``
``GifImagePlugin.__version__`` ``PalmImagePlugin.__version__`` ``WmfImagePlugin.__version__``
``IcoImagePlugin.__version__`` ``PcdImagePlugin.__version__`` ``XbmImagePlugin.__version__``
``ImImagePlugin.__version__`` ``PcxImagePlugin.__version__`` ``XpmImagePlugin.__version__``
``ImtImagePlugin.__version__`` ``PdfImagePlugin.__version__`` ``XVThumbImagePlugin.__version__``
``IptcImagePlugin.__version__`` ``PixarImagePlugin.__version__``
=============================== ================================= ==================================
PyQt4 and PySide
^^^^^^^^^^^^^^^^

View File

@ -27,10 +27,6 @@
from . import Image, ImageFile, ImagePalette
from ._binary import i8, i16le as i16, i32le as i32, o8, o16le as o16, o32le as o32
# __version__ is deprecated and will be removed in a future version. Use
# PIL.__version__ instead.
__version__ = "0.7"
#
# --------------------------------------------------------------------
# Read BMP file

View File

@ -18,10 +18,6 @@
from . import BmpImagePlugin, Image
from ._binary import i8, i16le as i16, i32le as i32
# __version__ is deprecated and will be removed in a future version. Use
# PIL.__version__ instead.
__version__ = "0.1"
#
# --------------------------------------------------------------------

View File

@ -25,10 +25,6 @@ from . import Image
from ._binary import i32le as i32
from .PcxImagePlugin import PcxImageFile
# __version__ is deprecated and will be removed in a future version. Use
# PIL.__version__ instead.
__version__ = "0.2"
MAGIC = 0x3ADE68B1 # QUIZ: what's this value, then?

View File

@ -30,10 +30,6 @@ import tempfile
from . import Image, ImageFile
from ._binary import i32le as i32
# __version__ is deprecated and will be removed in a future version. Use
# PIL.__version__ instead.
__version__ = "0.5"
#
# --------------------------------------------------------------------

View File

@ -19,11 +19,6 @@
from . import Image, ImageFile, ImagePalette
from ._binary import i8, i16le as i16, i32le as i32, o8
# __version__ is deprecated and will be removed in a future version. Use
# PIL.__version__ instead.
__version__ = "0.2"
#
# decoder

View File

@ -19,10 +19,6 @@ import olefile
from . import Image, ImageFile
from ._binary import i8, i32le as i32
# __version__ is deprecated and will be removed in a future version. Use
# PIL.__version__ instead.
__version__ = "0.1"
# we map from colour field tuples to (mode, rawmode) descriptors
MODES = {
# opacity

View File

@ -26,11 +26,6 @@
from . import ImageFile, ImagePalette
from ._binary import i8, i16be as i16, i32be as i32
# __version__ is deprecated and will be removed in a future version. Use
# PIL.__version__ instead.
__version__ = "0.1"
##
# Image plugin for the GD uncompressed format. Note that this format
# is not supported by the standard <b>Image.open</b> function. To use

View File

@ -31,11 +31,6 @@ import subprocess
from . import Image, ImageChops, ImageFile, ImagePalette, ImageSequence
from ._binary import i8, i16le as i16, o8, o16le as o16
# __version__ is deprecated and will be removed in a future version. Use
# PIL.__version__ instead.
__version__ = "0.9"
# --------------------------------------------------------------------
# Identify/read GIF files

View File

@ -30,10 +30,6 @@ from math import ceil, log
from . import BmpImagePlugin, Image, ImageFile, PngImagePlugin
from ._binary import i8, i16le as i16, i32le as i32
# __version__ is deprecated and will be removed in a future version. Use
# PIL.__version__ instead.
__version__ = "0.1"
#
# --------------------------------------------------------------------

View File

@ -31,11 +31,6 @@ import re
from . import Image, ImageFile, ImagePalette
from ._binary import i8
# __version__ is deprecated and will be removed in a future version. Use
# PIL.__version__ instead.
__version__ = "0.7"
# --------------------------------------------------------------------
# Standard tags

View File

@ -19,11 +19,6 @@ import re
from . import Image, ImageFile
# __version__ is deprecated and will be removed in a future version. Use
# PIL.__version__ instead.
__version__ = "0.2"
#
# --------------------------------------------------------------------

View File

@ -20,10 +20,6 @@ import tempfile
from . import Image, ImageFile
from ._binary import i8, i16be as i16, i32be as i32, o8
# __version__ is deprecated and will be removed in a future version. Use
# PIL.__version__ instead.
__version__ = "0.3"
COMPRESSION = {1: "raw", 5: "jpeg"}
PAD = o8(0) * 4

View File

@ -18,10 +18,6 @@ import struct
from . import Image, ImageFile
# __version__ is deprecated and will be removed in a future version. Use
# PIL.__version__ instead.
__version__ = "0.1"
def _parse_codestream(fp):
"""Parse the JPEG 2000 codestream to extract the size and component

View File

@ -43,11 +43,6 @@ from . import Image, ImageFile, TiffImagePlugin
from ._binary import i8, i16be as i16, i32be as i32, o8
from .JpegPresets import presets
# __version__ is deprecated and will be removed in a future version. Use
# PIL.__version__ instead.
__version__ = "0.6"
#
# Parser

View File

@ -20,10 +20,6 @@ import struct
from . import Image, ImageFile
# __version__ is deprecated and will be removed in a future version. Use
# PIL.__version__ instead.
__version__ = "0.2"
def _accept(s):
return s[:8] == b"\x00\x00\x00\x00\x00\x00\x00\x04"

View File

@ -21,11 +21,6 @@ import olefile
from . import Image, TiffImagePlugin
# __version__ is deprecated and will be removed in a future version. Use
# PIL.__version__ instead.
__version__ = "0.1"
#
# --------------------------------------------------------------------

View File

@ -17,11 +17,6 @@
from . import Image, ImageFile
from ._binary import i8
# __version__ is deprecated and will be removed in a future version. Use
# PIL.__version__ instead.
__version__ = "0.1"
#
# Bitstream parser

View File

@ -21,10 +21,6 @@
from . import Image, ImageFile, JpegImagePlugin
from ._binary import i16be as i16
# __version__ is deprecated and will be removed in a future version. Use
# PIL.__version__ instead.
__version__ = "0.1"
def _accept(prefix):
return JpegImagePlugin._accept(prefix)

View File

@ -29,11 +29,6 @@ import struct
from . import Image, ImageFile
from ._binary import i8, i16le as i16, o16le as o16
# __version__ is deprecated and will be removed in a future version. Use
# PIL.__version__ instead.
__version__ = "0.1"
#
# read MSP files

View File

@ -10,10 +10,6 @@
from . import Image, ImageFile
from ._binary import o8, o16be as o16b
# __version__ is deprecated and will be removed in a future version. Use
# PIL.__version__ instead.
__version__ = "1.0"
# fmt: off
_Palm8BitColormapValues = ( # noqa: E131
(255, 255, 255), (255, 204, 255), (255, 153, 255), (255, 102, 255),

View File

@ -18,11 +18,6 @@
from . import Image, ImageFile
from ._binary import i8
# __version__ is deprecated and will be removed in a future version. Use
# PIL.__version__ instead.
__version__ = "0.1"
##
# Image plugin for PhotoCD images. This plugin only reads the 768x512
# image from the file; higher resolutions are encoded in a proprietary

View File

@ -33,10 +33,6 @@ from ._binary import i8, i16le as i16, o8, o16le as o16
logger = logging.getLogger(__name__)
# __version__ is deprecated and will be removed in a future version. Use
# PIL.__version__ instead.
__version__ = "0.6"
def _accept(prefix):
return i8(prefix[0]) == 10 and i8(prefix[1]) in [0, 2, 3, 5]

View File

@ -24,12 +24,7 @@ import io
import os
import time
from . import Image, ImageFile, ImageSequence, PdfParser
# __version__ is deprecated and will be removed in a future version. Use
# PIL.__version__ instead.
__version__ = "0.5"
from . import Image, ImageFile, ImageSequence, PdfParser, __version__
#
# --------------------------------------------------------------------
@ -82,7 +77,7 @@ def _save(im, fp, filename, save_all=False):
existing_pdf.start_writing()
existing_pdf.write_header()
existing_pdf.write_comment("created by PIL PDF driver " + __version__)
existing_pdf.write_comment("created by Pillow {} PDF driver".format(__version__))
#
# pages

View File

@ -22,11 +22,6 @@
from . import Image, ImageFile
from ._binary import i16le as i16
# __version__ is deprecated and will be removed in a future version. Use
# PIL.__version__ instead.
__version__ = "0.1"
#
# helpers

View File

@ -39,10 +39,6 @@ import zlib
from . import Image, ImageFile, ImagePalette
from ._binary import i8, i16be as i16, i32be as i32, o16be as o16, o32be as o32
# __version__ is deprecated and will be removed in a future version. Use
# PIL.__version__ instead.
__version__ = "0.9"
logger = logging.getLogger(__name__)
is_cid = re.compile(br"\w\w\w\w").match

View File

@ -17,10 +17,6 @@
from . import Image, ImageFile
# __version__ is deprecated and will be removed in a future version. Use
# PIL.__version__ instead.
__version__ = "0.2"
#
# --------------------------------------------------------------------

View File

@ -16,10 +16,6 @@
# See the README file for information on usage and redistribution.
#
# __version__ is deprecated and will be removed in a future version. Use
# PIL.__version__ instead.
__version__ = "0.4"
import io
from . import Image, ImageFile, ImagePalette

View File

@ -28,10 +28,6 @@ import struct
from . import Image, ImageFile
from ._binary import i8, i16be as i16, o8
# __version__ is deprecated and will be removed in a future version. Use
# PIL.__version__ instead.
__version__ = "0.3"
def _accept(prefix):
return len(prefix) >= 2 and i16(prefix) == 474

View File

@ -20,10 +20,6 @@
from . import Image, ImageFile, ImagePalette
from ._binary import i32be as i32
# __version__ is deprecated and will be removed in a future version. Use
# PIL.__version__ instead.
__version__ = "0.3"
def _accept(prefix):
return len(prefix) >= 4 and i32(prefix) == 0x59A66A95

View File

@ -22,11 +22,6 @@ import warnings
from . import Image, ImageFile, ImagePalette
from ._binary import i8, i16le as i16, o8, o16le as o16
# __version__ is deprecated and will be removed in a future version. Use
# PIL.__version__ instead.
__version__ = "0.3"
#
# --------------------------------------------------------------------
# Read RGA file

View File

@ -52,9 +52,6 @@ from . import Image, ImageFile, ImagePalette, TiffTags
from ._binary import i8, o8
from .TiffTags import TYPES
# __version__ is deprecated and will be removed in a future version. Use
# PIL.__version__ instead.
__version__ = "1.3.5"
DEBUG = False # Needs to be merged with the new logging approach.
# Set these to true to force use of libtiff for reading or writing.

View File

@ -22,10 +22,6 @@
from . import Image, ImageFile
from ._binary import i16le as word, i32le as dword, si16le as short, si32le as _long
# __version__ is deprecated and will be removed in a future version. Use
# PIL.__version__ instead.
__version__ = "0.2"
_handler = None

View File

@ -20,10 +20,6 @@
from . import Image, ImageFile, ImagePalette
from ._binary import i8, o8
# __version__ is deprecated and will be removed in a future version. Use
# PIL.__version__ instead.
__version__ = "0.1"
_MAGIC = b"P7 332"
# standard color palette for thumbnails (RGB332)

View File

@ -23,10 +23,6 @@ import re
from . import Image, ImageFile
# __version__ is deprecated and will be removed in a future version. Use
# PIL.__version__ instead.
__version__ = "0.6"
# XBM header
xbm_head = re.compile(
br"\s*#define[ \t]+.*_width[ \t]+(?P<width>[0-9]+)[\r\n]+"

View File

@ -20,10 +20,6 @@ import re
from . import Image, ImageFile, ImagePalette
from ._binary import i8, o8
# __version__ is deprecated and will be removed in a future version. Use
# PIL.__version__ instead.
__version__ = "0.2"
# XPM header
xpm_head = re.compile(b'"([0-9]*) ([0-9]*) ([0-9]*) ([0-9]*)')