Merge branch 'main' into ci-appveyor-depends

This commit is contained in:
Andrew Murray 2023-09-20 22:34:01 +10:00
commit 4edfe13bec
8 changed files with 31 additions and 19 deletions

View File

@ -23,7 +23,7 @@ if [[ $(uname) != CYGWIN* ]]; then
sudo apt-get -qq install libfreetype6-dev liblcms2-dev python3-tk\ sudo apt-get -qq install libfreetype6-dev liblcms2-dev python3-tk\
ghostscript libffi-dev libjpeg-turbo-progs libopenjp2-7-dev\ ghostscript libffi-dev libjpeg-turbo-progs libopenjp2-7-dev\
cmake meson imagemagick libharfbuzz-dev libfribidi-dev\ cmake meson imagemagick libharfbuzz-dev libfribidi-dev\
sway wl-clipboard sway wl-clipboard libopenblas-dev
fi fi
python3 -m pip install --upgrade pip python3 -m pip install --upgrade pip
@ -38,8 +38,7 @@ python3 -m pip install -U pytest-timeout
python3 -m pip install pyroma python3 -m pip install pyroma
if [[ $(uname) != CYGWIN* ]]; then if [[ $(uname) != CYGWIN* ]]; then
# TODO Remove condition when NumPy supports 3.12 python3 -m pip install numpy
if ! [ "$GHA_PYTHON_VERSION" == "3.12-dev" ]; then python3 -m pip install numpy ; fi
# PyQt6 doesn't support PyPy3 # PyQt6 doesn't support PyPy3
if [[ $GHA_PYTHON_VERSION == 3.* ]]; then if [[ $GHA_PYTHON_VERSION == 3.* ]]; then

View File

@ -3,6 +3,7 @@
set -e set -e
brew install libtiff libjpeg openjpeg libimagequant webp little-cms2 freetype libraqm brew install libtiff libjpeg openjpeg libimagequant webp little-cms2 freetype libraqm
export PKG_CONFIG_PATH="/usr/local/opt/openblas/lib/pkgconfig"
PYTHONOPTIMIZE=0 python3 -m pip install cffi PYTHONOPTIMIZE=0 python3 -m pip install cffi
python3 -m pip install coverage python3 -m pip install coverage
@ -13,8 +14,7 @@ python3 -m pip install -U pytest-cov
python3 -m pip install -U pytest-timeout python3 -m pip install -U pytest-timeout
python3 -m pip install pyroma python3 -m pip install pyroma
# TODO Remove condition when NumPy supports 3.12 python3 -m pip install numpy
if ! [ "$GHA_PYTHON_VERSION" == "3.12-dev" ]; then python3 -m pip install numpy ; fi
# extra test images # extra test images
pushd depends && ./install_extra_test_images.sh && popd pushd depends && ./install_extra_test_images.sh && popd

View File

@ -102,10 +102,10 @@ jobs:
run: | run: |
bash.exe .ci/install.sh bash.exe .ci/install.sh
- name: Install latest NumPy - name: Upgrade NumPy
shell: dash.exe -l "{0}" shell: dash.exe -l "{0}"
run: | run: |
python3 -m pip install -U numpy python3 -m pip install -U "numpy<1.26"
- name: Build - name: Build
shell: bash.exe -eo pipefail -o igncr "{0}" shell: bash.exe -eo pipefail -o igncr "{0}"

View File

@ -5,6 +5,9 @@ Changelog (Pillow)
10.1.0 (unreleased) 10.1.0 (unreleased)
------------------- -------------------
- Fixed bug when reading BC5S DDS images #7401
[radarhere]
- Prevent TIFF orientation from being applied more than once #7383 - Prevent TIFF orientation from being applied more than once #7383
[radarhere] [radarhere]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 95 KiB

View File

@ -93,10 +93,14 @@ Generating images
Registering plugins Registering plugins
^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^
.. autofunction:: preinit
.. autofunction:: init
.. note:: .. note::
These functions are for use by plugin authors. Application authors can These functions are for use by plugin authors. They are called when a
ignore them. plugin is loaded as part of :py:meth:`~preinit()` or :py:meth:`~init()`.
Application authors can ignore them.
.. autofunction:: register_open .. autofunction:: register_open
.. autofunction:: register_mime .. autofunction:: register_mime

View File

@ -298,7 +298,11 @@ _initialized = 0
def preinit(): def preinit():
"""Explicitly load standard file format drivers.""" """
Explicitly loads BMP, GIF, JPEG, PPM and PPM file format drivers.
It is called when opening or saving images.
"""
global _initialized global _initialized
if _initialized >= 1: if _initialized >= 1:
@ -334,11 +338,6 @@ def preinit():
assert PngImagePlugin assert PngImagePlugin
except ImportError: except ImportError:
pass pass
# try:
# import TiffImagePlugin
# assert TiffImagePlugin
# except ImportError:
# pass
_initialized = 1 _initialized = 1
@ -347,6 +346,9 @@ def init():
""" """
Explicitly initializes the Python Imaging Library. This function Explicitly initializes the Python Imaging Library. This function
loads all available file format drivers. loads all available file format drivers.
It is called when opening or saving images if :py:meth:`~preinit()` is
insufficient, and by :py:meth:`~PIL.features.pilinfo`.
""" """
global _initialized global _initialized
@ -3407,8 +3409,12 @@ def register_open(id, factory, accept=None):
def register_mime(id, mimetype): def register_mime(id, mimetype):
""" """
Registers an image MIME type. This function should not be used Registers an image MIME type by populating ``Image.MIME``. This function
in application code. should not be used in application code.
``Image.MIME`` provides a mapping from image format identifiers to mime
formats, but :py:meth:`~PIL.ImageFile.ImageFile.get_format_mimetype` can
provide a different result for specific images.
:param id: An image format identifier. :param id: An image format identifier.
:param mimetype: The image MIME type for this format. :param mimetype: The image MIME type for this format.

View File

@ -118,8 +118,8 @@ decode_bc3_alpha(char *dst, const UINT8 *src, int stride, int o, int sign) {
if (sign == 1) { if (sign == 1) {
bc5s_alpha b; bc5s_alpha b;
memcpy(&b, src, sizeof(bc5s_alpha)); memcpy(&b, src, sizeof(bc5s_alpha));
a0 = (b.a0 + 255) / 2; a0 = b.a0 + 128;
a1 = (b.a1 + 255) / 2; a1 = b.a1 + 128;
lut1 = b.lut[0] | (b.lut[1] << 8) | (b.lut[2] << 16); lut1 = b.lut[0] | (b.lut[1] << 8) | (b.lut[2] << 16);
lut2 = b.lut[3] | (b.lut[4] << 8) | (b.lut[5] << 16); lut2 = b.lut[3] | (b.lut[4] << 8) | (b.lut[5] << 16);
} else { } else {