Merge branch 'master' into update-releasing

This commit is contained in:
Hugo van Kemenade 2020-12-01 11:06:32 +02:00 committed by GitHub
commit 036d90cc48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
55 changed files with 312 additions and 232 deletions

View File

@ -1,5 +1,4 @@
version: '{build}' version: '{build}'
image: Visual Studio 2017
clone_folder: c:\pillow clone_folder: c:\pillow
init: init:
- ECHO %PYTHON% - ECHO %PYTHON%
@ -8,21 +7,22 @@ init:
environment: environment:
EXECUTABLE: python.exe EXECUTABLE: python.exe
PIP_DIR: Scripts
TEST_OPTIONS: TEST_OPTIONS:
DEPLOY: YES DEPLOY: YES
matrix: matrix:
- PYTHON: C:/Python38 - PYTHON: C:/Python39
ARCHITECTURE: x86 ARCHITECTURE: x86
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
- PYTHON: C:/Python36-x64 - PYTHON: C:/Python36-x64
ARCHITECTURE: x64 ARCHITECTURE: x64
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
install: install:
- curl -fsSL -o pillow-depends.zip https://github.com/python-pillow/pillow-depends/archive/master.zip - curl -fsSL -o pillow-depends.zip https://github.com/python-pillow/pillow-depends/archive/master.zip
- 7z x pillow-depends.zip -oc:\ - 7z x pillow-depends.zip -oc:\
- mv c:\pillow-depends-master c:\pillow-depends - mv c:\pillow-depends-master c:\pillow-depends
- xcopy /s c:\pillow-depends\test_images\* c:\pillow\tests\images - xcopy /S /Y c:\pillow-depends\test_images\* c:\pillow\tests\images
- 7z x ..\pillow-depends\nasm-2.14.02-win64.zip -oc:\ - 7z x ..\pillow-depends\nasm-2.14.02-win64.zip -oc:\
- ..\pillow-depends\gs9533w32.exe /S - ..\pillow-depends\gs9533w32.exe /S
- path c:\nasm-2.14.02;C:\Program Files (x86)\gs\gs9.53.3\bin;%PATH% - path c:\nasm-2.14.02;C:\Program Files (x86)\gs\gs9.53.3\bin;%PATH%
@ -32,6 +32,7 @@ install:
c:\pillow\winbuild\build\build_dep_all.cmd c:\pillow\winbuild\build\build_dep_all.cmd
$host.SetShouldExit(0) $host.SetShouldExit(0)
- path C:\pillow\winbuild\build\bin;%PATH% - path C:\pillow\winbuild\build\bin;%PATH%
- '%PYTHON%\%EXECUTABLE% -m pip install -U "setuptools>=49.3.2"'
build_script: build_script:
- ps: | - ps: |
@ -42,13 +43,13 @@ build_script:
test_script: test_script:
- cd c:\pillow - cd c:\pillow
- '%PYTHON%\%PIP_DIR%\pip.exe install pytest pytest-cov' - '%PYTHON%\%EXECUTABLE% -m pip install pytest pytest-cov'
- c:\"Program Files (x86)"\"Windows Kits"\10\Debuggers\x86\gflags.exe /p /enable %PYTHON%\%EXECUTABLE% - c:\"Program Files (x86)"\"Windows Kits"\10\Debuggers\x86\gflags.exe /p /enable %PYTHON%\%EXECUTABLE%
- '%PYTHON%\%EXECUTABLE% -m pytest -vx --cov PIL --cov Tests --cov-report term --cov-report xml Tests' - '%PYTHON%\%EXECUTABLE% -m pytest -vx --cov PIL --cov Tests --cov-report term --cov-report xml Tests'
#- '%PYTHON%\%EXECUTABLE% test-installed.py -v -s %TEST_OPTIONS%' TODO TEST_OPTIONS with pytest? #- '%PYTHON%\%EXECUTABLE% test-installed.py -v -s %TEST_OPTIONS%' TODO TEST_OPTIONS with pytest?
after_test: after_test:
- pip install codecov - python -m pip install codecov
- codecov --file coverage.xml --name %PYTHON% --flags AppVeyor - codecov --file coverage.xml --name %PYTHON% --flags AppVeyor
matrix: matrix:
@ -65,7 +66,7 @@ artifacts:
before_deploy: before_deploy:
- cd c:\pillow - cd c:\pillow
- '%PYTHON%\%PIP_DIR%\pip.exe install wheel' - '%PYTHON%\%EXECUTABLE% -m pip install wheel'
- cd c:\pillow\winbuild\ - cd c:\pillow\winbuild\
- c:\pillow\winbuild\build\build_pillow.cmd bdist_wheel - c:\pillow\winbuild\build\build_pillow.cmd bdist_wheel
- cd c:\pillow - cd c:\pillow

View File

@ -12,7 +12,7 @@ if [[ $TRAVIS ]]; then
codecov --flags TravisCI codecov --flags TravisCI
fi fi
if [ "$TRAVIS_PYTHON_VERSION" == "3.8" ]; then if [ "$TRAVIS_PYTHON_VERSION" == "3.9" ]; then
# Coverage and quality reports on just the latest diff. # Coverage and quality reports on just the latest diff.
depends/diffcover-install.sh depends/diffcover-install.sh
depends/diffcover-run.sh depends/diffcover-run.sh

View File

@ -21,34 +21,35 @@ 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 imagemagick libharfbuzz-dev libfribidi-dev cmake imagemagick libharfbuzz-dev libfribidi-dev
if [[ $TRAVIS_CPU_ARCH == "s390x" || $TRAVIS_CPU_ARCH == "ppc64le" ]]; then sudo chown $USER ~/.cache/pip/wheels ; fi if [[ $TRAVIS_CPU_ARCH == "s390x" ]]; then sudo chown $USER ~/.cache/pip/wheels ; fi
pip install --upgrade pip python3 -m pip install --upgrade pip
PYTHONOPTIMIZE=0 pip install cffi PYTHONOPTIMIZE=0 python3 -m pip install cffi
pip install coverage python3 -m pip install coverage
pip install olefile python3 -m pip install olefile
pip install -U pytest python3 -m pip install -U pytest
pip install -U pytest-cov python3 -m pip install -U pytest-cov
pip install pyroma python3 -m pip install pyroma
pip install test-image-results python3 -m pip install test-image-results
pip install numpy # TODO Remove condition when numpy supports 3.10
if ! [ "$GHA_PYTHON_VERSION" == "3.10-dev" ]; then python3 -m pip install numpy ; fi
# TODO Remove when 3.8 / 3.9 / PyPy3 includes setuptools 49.3.2+: # TODO Remove when 3.8 / 3.9 / PyPy3 includes setuptools 49.3.2+:
if [ "$GHA_PYTHON_VERSION" == "3.8" ]; then pip install -U "setuptools>=49.3.2" ; fi if [ "$GHA_PYTHON_VERSION" == "3.8" ]; then python3 -m pip install -U "setuptools>=49.3.2" ; fi
if [ "$GHA_PYTHON_VERSION" == "3.9" ]; then pip install -U "setuptools>=49.3.2" ; fi if [ "$GHA_PYTHON_VERSION" == "3.9" ]; then python3 -m pip install -U "setuptools>=49.3.2" ; fi
if [ "$TRAVIS_PYTHON_VERSION" == "pypy3.6-7.3.1" ]; then pip install -U "setuptools>=49.3.2" ; fi if [ "$TRAVIS_PYTHON_VERSION" == "pypy3.6-7.3.1" ]; then python3 -m pip install -U "setuptools>=49.3.2" ; fi
if [[ $TRAVIS_PYTHON_VERSION == 3.* ]]; then # PyQt5 doesn't support PyPy3
# Wheel doesn't yet support 3.10
if [[ $GHA_PYTHON_VERSION == 3.* && $GHA_PYTHON_VERSION != "3.10-dev" ]]; then
# arm64, ppc64le, s390x CPUs: # arm64, ppc64le, s390x CPUs:
# "ERROR: Could not find a version that satisfies the requirement pyqt5" # "ERROR: Could not find a version that satisfies the requirement pyqt5"
if [[ $TRAVIS_CPU_ARCH == "amd64" ]]; then
sudo apt-get -qq install libxcb-xinerama0 pyqt5-dev-tools sudo apt-get -qq install libxcb-xinerama0 pyqt5-dev-tools
pip install pyqt5 python3 -m pip install pyqt5
fi
fi fi
# docs only on Python 3.8 # docs only on Python 3.9
if [ "$TRAVIS_PYTHON_VERSION" == "3.8" ]; then pip install -r requirements.txt ; fi if [ "$TRAVIS_PYTHON_VERSION" == "3.9" ]; then python3 -m pip install -r requirements.txt ; fi
# webp # webp
pushd depends && ./install_webp.sh && popd pushd depends && ./install_webp.sh && popd

View File

@ -5,6 +5,6 @@ set -e
python -bb -m pytest -v -x -W always --cov PIL --cov Tests --cov-report term Tests python -bb -m pytest -v -x -W always --cov PIL --cov Tests --cov-report term Tests
# Docs # Docs
if [ "$TRAVIS_PYTHON_VERSION" == "3.8" ] && [ "$TRAVIS_CPU_ARCH" == "amd64" ]; then if [ "$TRAVIS_PYTHON_VERSION" == "3.9" ] && [ "$TRAVIS_CPU_ARCH" == "amd64" ]; then
make doccheck make doccheck
fi fi

View File

@ -9,7 +9,7 @@ Please send a pull request to the master branch. Please include [documentation](
- Fork the Pillow repository. - Fork the Pillow repository.
- Create a branch from master. - Create a branch from master.
- Develop bug fixes, features, tests, etc. - Develop bug fixes, features, tests, etc.
- Run the test suite. You can enable [Travis CI](https://travis-ci.org/profile/) and [AppVeyor](https://ci.appveyor.com/projects/new) on your repo to catch test failures prior to the pull request, and [Codecov](https://codecov.io/gh) to see if the changed code is covered by tests. - Run the test suite. You can enable [Travis CI](https://travis-ci.com/account/repositories) and [AppVeyor](https://ci.appveyor.com/projects/new) on your repo to catch test failures prior to the pull request, and [Codecov](https://codecov.io/gh) to see if the changed code is covered by tests.
- Create a pull request to pull the changes from your branch to the Pillow master. - Create a pull request to pull the changes from your branch to the Pillow master.
### Guidelines ### Guidelines
@ -17,7 +17,7 @@ Please send a pull request to the master branch. Please include [documentation](
- Separate code commits from reformatting commits. - Separate code commits from reformatting commits.
- Provide tests for any newly added code. - Provide tests for any newly added code.
- Follow PEP 8. - Follow PEP 8.
- When committing only documentation changes please include [ci skip] in the commit message to avoid running tests on Travis-CI and AppVeyor. - When committing only documentation changes please include `[ci skip]` in the commit message to avoid running tests on Travis CI and AppVeyor.
## Reporting Issues ## Reporting Issues

2
.github/mergify.yml vendored
View File

@ -7,8 +7,8 @@ pull_request_rules:
- status-success=Test Successful - status-success=Test Successful
- status-success=Docker Test Successful - status-success=Docker Test Successful
- status-success=Windows Test Successful - status-success=Windows Test Successful
- status-success=Travis CI - Pull Request
- status-success=continuous-integration/appveyor/pr - status-success=continuous-integration/appveyor/pr
- status-success=continuous-integration/travis-ci/pr
actions: actions:
merge: merge:
method: merge method: merge

14
.github/release-drafter.yml vendored Normal file
View File

@ -0,0 +1,14 @@
name-template: "$NEXT_MINOR_VERSION"
tag-template: "$NEXT_MINOR_VERSION"
change-template: '- $TITLE #$NUMBER [@$AUTHOR]'
exclude-labels:
- "changelog: skip"
template: |
https://pillow.readthedocs.io/en/stable/releasenotes/$NEXT_MINOR_VERSION.html
## Changes
$CHANGES

View File

@ -2,22 +2,23 @@
set -e set -e
brew install libtiff libjpeg openjpeg libimagequant webp little-cms2 freetype openblas brew install libtiff libjpeg openjpeg libimagequant webp little-cms2 freetype openblas libraqm
PYTHONOPTIMIZE=0 pip install cffi PYTHONOPTIMIZE=0 python3 -m pip install cffi
pip install coverage python3 -m pip install coverage
pip install olefile python3 -m pip install olefile
pip install -U pytest python3 -m pip install -U pytest
pip install -U pytest-cov python3 -m pip install -U pytest-cov
pip install pyroma python3 -m pip install pyroma
pip install test-image-results python3 -m pip install test-image-results
echo -e "[openblas]\nlibraries = openblas\nlibrary_dirs = /usr/local/opt/openblas/lib" >> ~/.numpy-site.cfg echo -e "[openblas]\nlibraries = openblas\nlibrary_dirs = /usr/local/opt/openblas/lib" >> ~/.numpy-site.cfg
pip install numpy # TODO Remove condition when numpy supports 3.10
if ! [ "$GHA_PYTHON_VERSION" == "3.10-dev" ]; then python3 -m pip install numpy ; fi
# TODO Remove when 3.8 / 3.9 includes setuptools 49.3.2+: # TODO Remove when 3.8 / 3.9 includes setuptools 49.3.2+:
if [ "$GHA_PYTHON_VERSION" == "3.8" ]; then pip install -U "setuptools>=49.3.2" ; fi if [ "$GHA_PYTHON_VERSION" == "3.8" ]; then python3 -m pip install -U "setuptools>=49.3.2" ; fi
if [ "$GHA_PYTHON_VERSION" == "3.9" ]; then pip install -U "setuptools>=49.3.2" ; fi if [ "$GHA_PYTHON_VERSION" == "3.9" ]; then python3 -m pip install -U "setuptools>=49.3.2" ; fi
# extra test images # extra test images
pushd depends && ./install_extra_test_images.sh && popd pushd depends && ./install_extra_test_images.sh && popd

17
.github/workflows/release-drafter.yml vendored Normal file
View File

@ -0,0 +1,17 @@
name: Release drafter
on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- master
jobs:
update_release_draft:
if: github.repository == 'python-pillow/Pillow'
runs-on: ubuntu-latest
steps:
# Drafts your next release notes as pull requests are merged into "master"
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -11,17 +11,15 @@ jobs:
matrix: matrix:
docker: [ docker: [
alpine, alpine,
amazon-2-amd64,
arch, arch,
ubuntu-18.04-bionic-amd64,
ubuntu-20.04-focal-amd64,
debian-10-buster-x86,
centos-6-amd64,
centos-7-amd64, centos-7-amd64,
centos-8-amd64, centos-8-amd64,
amazon-1-amd64, debian-10-buster-x86,
amazon-2-amd64,
fedora-31-amd64,
fedora-32-amd64, fedora-32-amd64,
fedora-33-amd64,
ubuntu-18.04-bionic-amd64,
ubuntu-20.04-focal-amd64,
] ]
dockerTag: [master] dockerTag: [master]

View File

@ -8,7 +8,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "pypy3"] python-version: ["3.6", "3.7", "3.8", "3.9", "3.10-dev", "pypy3"]
architecture: ["x86", "x64"] architecture: ["x86", "x64"]
include: include:
- architecture: "x86" - architecture: "x86"
@ -52,15 +52,10 @@ jobs:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }} architecture: ${{ matrix.architecture }}
- name: Set up TCL
if: "contains(matrix.python-version, 'pypy')"
run: echo "TCL_LIBRARY=$env:pythonLocation\tcl\tcl8.5" >> $env:GITHUB_ENV
shell: pwsh
- name: Print build system information - name: Print build system information
run: python .github/workflows/system-info.py run: python .github/workflows/system-info.py
- name: pip install wheel pytest pytest-cov - name: python -m pip install wheel pytest pytest-cov
run: python -m pip install wheel pytest pytest-cov run: python -m pip install wheel pytest pytest-cov
# TODO Remove when 3.8 / 3.9 includes setuptools 49.3.2+: # TODO Remove when 3.8 / 3.9 includes setuptools 49.3.2+:
@ -69,6 +64,7 @@ jobs:
run: python -m pip install -U "setuptools>=49.3.2" run: python -m pip install -U "setuptools>=49.3.2"
- name: Install dependencies - name: Install dependencies
id: install
run: | run: |
7z x winbuild\depends\nasm-2.14.02-win64.zip "-o$env:RUNNER_WORKSPACE\" 7z x winbuild\depends\nasm-2.14.02-win64.zip "-o$env:RUNNER_WORKSPACE\"
echo "$env:RUNNER_WORKSPACE\nasm-2.14.02" >> $env:GITHUB_PATH echo "$env:RUNNER_WORKSPACE\nasm-2.14.02" >> $env:GITHUB_PATH
@ -76,7 +72,10 @@ jobs:
winbuild\depends\gs9533w32.exe /S winbuild\depends\gs9533w32.exe /S
echo "C:\Program Files (x86)\gs\gs9.53.3\bin" >> $env:GITHUB_PATH echo "C:\Program Files (x86)\gs\gs9.53.3\bin" >> $env:GITHUB_PATH
xcopy /s winbuild\depends\test_images\* Tests\images\ xcopy /S /Y winbuild\depends\test_images\* Tests\images\
# make cache key depend on VS version
& "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" | find """catalog_buildVersion""" | ForEach-Object { $a = $_.split(" ")[1]; echo "::set-output name=vs::$a" }
shell: pwsh shell: pwsh
- name: Cache build - name: Cache build
@ -85,7 +84,7 @@ jobs:
with: with:
path: winbuild\build path: winbuild\build
key: key:
${{ hashFiles('winbuild\build_prepare.py') }}-${{ hashFiles('.github\workflows\test-windows.yml') }}-${{ env.pythonLocation }} ${{ hashFiles('winbuild\build_prepare.py') }}-${{ hashFiles('.github\workflows\test-windows.yml') }}-${{ env.pythonLocation }}-${{ steps.install.outputs.vs }}
- name: Prepare build - name: Prepare build
if: steps.build-cache.outputs.cache-hit != 'true' if: steps.build-cache.outputs.cache-hit != 'true'
@ -96,25 +95,32 @@ jobs:
- name: Build dependencies / libjpeg-turbo - name: Build dependencies / libjpeg-turbo
if: steps.build-cache.outputs.cache-hit != 'true' if: steps.build-cache.outputs.cache-hit != 'true'
run: "& winbuild\\build\\build_dep_libjpeg.cmd" run: "& winbuild\\build\\build_dep_libjpeg.cmd"
- name: Build dependencies / zlib - name: Build dependencies / zlib
if: steps.build-cache.outputs.cache-hit != 'true' if: steps.build-cache.outputs.cache-hit != 'true'
run: "& winbuild\\build\\build_dep_zlib.cmd" run: "& winbuild\\build\\build_dep_zlib.cmd"
- name: Build dependencies / LibTiff - name: Build dependencies / LibTiff
if: steps.build-cache.outputs.cache-hit != 'true' if: steps.build-cache.outputs.cache-hit != 'true'
run: "& winbuild\\build\\build_dep_libtiff.cmd" run: "& winbuild\\build\\build_dep_libtiff.cmd"
- name: Build dependencies / WebP - name: Build dependencies / WebP
if: steps.build-cache.outputs.cache-hit != 'true' if: steps.build-cache.outputs.cache-hit != 'true'
run: "& winbuild\\build\\build_dep_libwebp.cmd" run: "& winbuild\\build\\build_dep_libwebp.cmd"
# for FreeType CBDT font support # for FreeType CBDT font support
- name: Build dependencies / libpng - name: Build dependencies / libpng
if: steps.build-cache.outputs.cache-hit != 'true' if: steps.build-cache.outputs.cache-hit != 'true'
run: "& winbuild\\build\\build_dep_libpng.cmd" run: "& winbuild\\build\\build_dep_libpng.cmd"
- name: Build dependencies / FreeType - name: Build dependencies / FreeType
if: steps.build-cache.outputs.cache-hit != 'true' if: steps.build-cache.outputs.cache-hit != 'true'
run: "& winbuild\\build\\build_dep_freetype.cmd" run: "& winbuild\\build\\build_dep_freetype.cmd"
- name: Build dependencies / LCMS2 - name: Build dependencies / LCMS2
if: steps.build-cache.outputs.cache-hit != 'true' if: steps.build-cache.outputs.cache-hit != 'true'
run: "& winbuild\\build\\build_dep_lcms2.cmd" run: "& winbuild\\build\\build_dep_lcms2.cmd"
- name: Build dependencies / OpenJPEG - name: Build dependencies / OpenJPEG
if: steps.build-cache.outputs.cache-hit != 'true' if: steps.build-cache.outputs.cache-hit != 'true'
run: "& winbuild\\build\\build_dep_openjpeg.cmd" run: "& winbuild\\build\\build_dep_openjpeg.cmd"
@ -128,9 +134,11 @@ jobs:
- name: Build dependencies / HarfBuzz - name: Build dependencies / HarfBuzz
if: steps.build-cache.outputs.cache-hit != 'true' if: steps.build-cache.outputs.cache-hit != 'true'
run: "& winbuild\\build\\build_dep_harfbuzz.cmd" run: "& winbuild\\build\\build_dep_harfbuzz.cmd"
- name: Build dependencies / FriBidi - name: Build dependencies / FriBidi
if: steps.build-cache.outputs.cache-hit != 'true' if: steps.build-cache.outputs.cache-hit != 'true'
run: "& winbuild\\build\\build_dep_fribidi.cmd" run: "& winbuild\\build\\build_dep_fribidi.cmd"
- name: Build dependencies / Raqm - name: Build dependencies / Raqm
if: steps.build-cache.outputs.cache-hit != 'true' if: steps.build-cache.outputs.cache-hit != 'true'
run: "& winbuild\\build\\build_dep_libraqm.cmd" run: "& winbuild\\build\\build_dep_libraqm.cmd"
@ -187,14 +195,16 @@ jobs:
- name: Build wheel - name: Build wheel
id: wheel id: wheel
if: "github.event_name == 'push'" # Skip wheels on 3.10 due to https://github.com/pypa/wheel/issues/354
if: "github.event_name == 'push' && !contains(matrix.python-version, '3.10')"
run: | run: |
for /f "tokens=3 delims=/" %%a in ("${{ github.ref }}") do echo ::set-output name=dist::dist-%%a for /f "tokens=3 delims=/" %%a in ("${{ github.ref }}") do echo ::set-output name=dist::dist-%%a
winbuild\\build\\build_pillow.cmd --disable-imagequant bdist_wheel winbuild\\build\\build_pillow.cmd --disable-imagequant bdist_wheel
shell: cmd shell: cmd
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2
if: "github.event_name == 'push'" # Skip wheels on 3.10 due to https://github.com/pypa/wheel/issues/354
if: "github.event_name == 'push' && !contains(matrix.python-version, '3.10')"
with: with:
name: ${{ steps.wheel.outputs.dist }} name: ${{ steps.wheel.outputs.dist }}
path: dist\*.whl path: dist\*.whl

View File

@ -14,6 +14,7 @@ jobs:
] ]
python-version: [ python-version: [
"pypy3", "pypy3",
"3.10-dev",
"3.9", "3.9",
"3.8", "3.8",
"3.7", "3.7",
@ -21,9 +22,9 @@ jobs:
] ]
include: include:
- python-version: "3.6" - python-version: "3.6"
env: PYTHONOPTIMIZE=1 PYTHONOPTIMIZE: 1
- python-version: "3.7" - python-version: "3.7"
env: PYTHONOPTIMIZE=2 PYTHONOPTIMIZE: 2
# Include new variables for Codecov # Include new variables for Codecov
- os: ubuntu-latest - os: ubuntu-latest
codecov-flag: GHA_Ubuntu codecov-flag: GHA_Ubuntu
@ -44,7 +45,7 @@ jobs:
- name: Get pip cache dir - name: Get pip cache dir
id: pip-cache id: pip-cache
run: | run: |
echo "::set-output name=dir::$(pip cache dir)" echo "::set-output name=dir::$(python3 -m pip cache dir)"
- name: pip cache - name: pip cache
uses: actions/cache@v2 uses: actions/cache@v2
@ -78,7 +79,13 @@ jobs:
- name: Test - name: Test
run: | run: |
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
xvfb-run -s '-screen 0 1024x768x24' .ci/test.sh
else
.ci/test.sh .ci/test.sh
fi
env:
PYTHONOPTIMIZE: ${{ matrix.PYTHONOPTIMIZE }}
- name: Prepare to upload errors - name: Prepare to upload errors
if: failure() if: failure()
@ -94,9 +101,9 @@ jobs:
path: Tests/errors path: Tests/errors
- name: Docs - name: Docs
if: startsWith(matrix.os, 'ubuntu') && matrix.python-version == 3.8 if: startsWith(matrix.os, 'ubuntu') && matrix.python-version == 3.9
run: | run: |
pip install sphinx-removed-in sphinx-rtd-theme python3 -m pip install sphinx-removed-in sphinx-rtd-theme
make doccheck make doccheck
- name: After success - name: After success

4
.gitignore vendored
View File

@ -81,6 +81,10 @@ docs/_build/
# Extra test images installed from pillow-depends/test_images # Extra test images installed from pillow-depends/test_images
Tests/images/README.md Tests/images/README.md
Tests/images/crash_1.tif
Tests/images/crash_2.tif
Tests/images/string_dimension.tiff
Tests/images/jpeg2000
Tests/images/msp Tests/images/msp
Tests/images/picins Tests/images/picins
Tests/images/sunraster Tests/images/sunraster

View File

@ -1,24 +1,13 @@
dist: xenial dist: xenial
language: python language: python
cache: cache: pip
pip: true
directories:
- $HOME/.cache/pre-commit
notifications: notifications:
irc: "chat.freenode.net#pil" irc: "chat.freenode.net#pil"
# Run fast lint first to get fast feedback.
# Run slower CPUs next, to give them a headstart and reduce waiting time.
# Then run the remainder.
matrix: matrix:
fast_finish: true fast_finish: true
include: include:
- python: "3.6"
name: "Lint"
env: LINT="true"
- python: "3.6" - python: "3.6"
arch: arm64 arch: arm64
- python: "3.7" - python: "3.7"
@ -26,45 +15,15 @@ matrix:
- python: "3.8" - python: "3.8"
arch: s390x arch: s390x
- python: "pypy3.6-7.3.1"
name: "PyPy3 Xenial"
- python: "3.9-dev"
name: "3.9-dev Xenial"
services: xvfb
- python: "3.8"
name: "3.8 Xenial"
services: xvfb
- python: '3.7'
name: "3.7 Xenial PYTHONOPTIMIZE=2"
env: PYTHONOPTIMIZE=2
services: xvfb
- python: '3.6'
name: "3.6 Xenial PYTHONOPTIMIZE=1"
env: PYTHONOPTIMIZE=1
services: xvfb
allow_failures:
- python: "3.9-dev"
install: install:
- | - |
if [ "$LINT" == "true" ]; then
pip install tox
else
.ci/install.sh; .ci/install.sh;
fi
script: script:
- | - |
if [ "$LINT" == "true" ]; then
tox -e lint
else
.ci/build.sh .ci/build.sh
.ci/test.sh .ci/test.sh
fi
after_success: after_success:
- | - |
if [ "$LINT" == "" ]; then
.ci/after_success.sh .ci/after_success.sh
fi

View File

@ -2,6 +2,21 @@
Changelog (Pillow) Changelog (Pillow)
================== ==================
8.1.0 (unreleased)
------------------
- Support raw rgba8888 for DDS #4760
[qiankanglai]
8.0.1 (2020-10-22)
------------------
- Update FreeType used in binary wheels to 2.10.4 to fix CVE-2020-15999.
[radarhere]
- Moved string_dimension image to pillow-depends #4993
[radarhere]
8.0.0 (2020-10-15) 8.0.0 (2020-10-15)
------------------ ------------------

View File

@ -7,7 +7,7 @@ Pillow is the friendly PIL fork. It is
Copyright © 2010-2020 by Alex Clark and contributors Copyright © 2010-2020 by Alex Clark and contributors
Like PIL, Pillow is licensed under the open source PIL Software License: Like PIL, Pillow is licensed under the open source HPND License:
By obtaining, using, and/or copying this software and/or its associated By obtaining, using, and/or copying this software and/or its associated
documentation, you agree that you have read, understood, and will comply documentation, you agree that you have read, understood, and will comply

View File

@ -91,6 +91,8 @@ release-test:
python3 selftest.py python3 selftest.py
python3 -m pytest Tests python3 -m pytest Tests
python3 setup.py install python3 setup.py install
-rm dist/*.egg
-rmdir dist
python3 -m pytest -qq python3 -m pytest -qq
check-manifest check-manifest
pyroma . pyroma .

View File

@ -24,12 +24,12 @@ As of 2019, Pillow development is
<tr> <tr>
<th>tests</th> <th>tests</th>
<td> <td>
<a href="https://travis-ci.org/python-pillow/Pillow"><img <a href="https://travis-ci.com/github/python-pillow/Pillow"><img
alt="Travis CI build status (Linux)" alt="Travis CI build status (Linux)"
src="https://img.shields.io/travis/python-pillow/Pillow/master.svg?label=Linux%20build"></a> src="https://img.shields.io/travis/com/python-pillow/Pillow/master.svg?label=Linux%20build"></a>
<a href="https://travis-ci.org/python-pillow/pillow-wheels"><img <a href="https://travis-ci.com/github/python-pillow/pillow-wheels"><img
alt="Travis CI build status (macOS)" alt="Travis CI build status (macOS)"
src="https://img.shields.io/travis/python-pillow/pillow-wheels/master.svg?label=macOS%20build"></a> src="https://img.shields.io/travis/com/python-pillow/pillow-wheels/master.svg?label=macOS%20build"></a>
<a href="https://ci.appveyor.com/project/python-pillow/Pillow"><img <a href="https://ci.appveyor.com/project/python-pillow/Pillow"><img
alt="AppVeyor CI build status (Windows)" alt="AppVeyor CI build status (Windows)"
src="https://img.shields.io/appveyor/build/python-pillow/Pillow/master.svg?label=Windows%20build"></a> src="https://img.shields.io/appveyor/build/python-pillow/Pillow/master.svg?label=Windows%20build"></a>

View File

@ -6,10 +6,7 @@ Released quarterly on January 2nd, April 1st, July 1st and October 15th.
* [ ] Open a release ticket e.g. https://github.com/python-pillow/Pillow/issues/3154 * [ ] Open a release ticket e.g. https://github.com/python-pillow/Pillow/issues/3154
* [ ] Develop and prepare release in `master` branch. * [ ] Develop and prepare release in `master` branch.
* [ ] Check [GitHub Actions](https://github.com/python-pillow/Pillow/actions), * [ ] Check [GitHub Actions](https://github.com/python-pillow/Pillow/actions), [Travis CI](https://travis-ci.com/github/python-pillow/Pillow) and [AppVeyor](https://ci.appveyor.com/project/python-pillow/Pillow) to confirm passing tests in `master` branch.
[Travis CI](https://travis-ci.org/github/python-pillow/Pillow) and
[AppVeyor](https://ci.appveyor.com/project/python-pillow/Pillow) to confirm
passing tests in `master` branch.
* [ ] Check that all of the wheel builds [Pillow Wheel Builder](https://github.com/python-pillow/pillow-wheels) pass the tests in Travis CI. * [ ] Check that all of the wheel builds [Pillow Wheel Builder](https://github.com/python-pillow/pillow-wheels) pass the tests in Travis CI.
* [ ] In compliance with [PEP 440](https://www.python.org/dev/peps/pep-0440/), update version identifier in `src/PIL/_version.py` * [ ] In compliance with [PEP 440](https://www.python.org/dev/peps/pep-0440/), update version identifier in `src/PIL/_version.py`
* [ ] Update `CHANGES.rst`. * [ ] Update `CHANGES.rst`.
@ -32,7 +29,7 @@ Released quarterly on January 2nd, April 1st, July 1st and October 15th.
twine check dist/* twine check dist/*
twine upload dist/Pillow-5.2.0* twine upload dist/Pillow-5.2.0*
``` ```
* [ ] Create a [new release on GitHub](https://github.com/python-pillow/Pillow/releases/new) * [ ] Publish the [release on GitHub](https://github.com/python-pillow/Pillow/releases)
* [ ] In compliance with [PEP 440](https://www.python.org/dev/peps/pep-0440/), increment and append `.dev0` to version identifier in `src/PIL/_version.py` * [ ] In compliance with [PEP 440](https://www.python.org/dev/peps/pep-0440/), increment and append `.dev0` to version identifier in `src/PIL/_version.py`
## Point Release ## Point Release
@ -45,14 +42,11 @@ Released as needed for security, installation or critical bug fixes.
```bash ```bash
git checkout -t remotes/origin/5.2.x git checkout -t remotes/origin/5.2.x
``` ```
* [ ] Cherry pick individual commits from `master` branch to release branch e.g. `5.2.x`. * [ ] Cherry pick individual commits from `master` branch to release branch e.g. `5.2.x`, then `git push`.
* [ ] Check [GitHub Actions](https://github.com/python-pillow/Pillow/actions), * [ ] Check [GitHub Actions](https://github.com/python-pillow/Pillow/actions), [Travis CI](https://travis-ci.com/github/python-pillow/Pillow) and [AppVeyor](https://ci.appveyor.com/project/python-pillow/Pillow) to confirm passing tests in release branch e.g. `5.2.x`.
[Travis CI](https://travis-ci.org/github/python-pillow/Pillow) and
[AppVeyor](https://ci.appveyor.com/project/python-pillow/Pillow) to confirm
passing tests in release branch e.g. `5.2.x`.
* [ ] In compliance with [PEP 440](https://www.python.org/dev/peps/pep-0440/), update version identifier in `src/PIL/_version.py` * [ ] In compliance with [PEP 440](https://www.python.org/dev/peps/pep-0440/), update version identifier in `src/PIL/_version.py`
* [ ] Run pre-release check via `make release-test`. * [ ] Run pre-release check via `make release-test`.
* [ ] Create tag for release e.g.: * [ ] Create tag for release e.g.:
@ -72,7 +66,7 @@ Released as needed for security, installation or critical bug fixes.
twine check dist/* twine check dist/*
twine upload dist/Pillow-5.2.0* twine upload dist/Pillow-5.2.0*
``` ```
* [ ] Create a [new release on GitHub](https://github.com/python-pillow/Pillow/releases/new) * [ ] Publish the [release on GitHub](https://github.com/python-pillow/Pillow/releases)
## Embargoed Release ## Embargoed Release
@ -97,7 +91,7 @@ Released as needed privately to individual vendors for critical security-related
twine check dist/* twine check dist/*
``` ```
* [ ] Create [binary distributions](https://github.com/python-pillow/Pillow/blob/master/RELEASING.md#binary-distributions) * [ ] Create [binary distributions](https://github.com/python-pillow/Pillow/blob/master/RELEASING.md#binary-distributions)
* [ ] Create a [new release on GitHub](https://github.com/python-pillow/Pillow/releases/new) * [ ] Publish the [release on GitHub](https://github.com/python-pillow/Pillow/releases)
## Binary Distributions ## Binary Distributions

View File

@ -11,6 +11,8 @@ BungeeColor-Regular_colr_Windows.ttf, from https://github.com/djrrb/bungee
All of the above fonts are published under the SIL Open Font License (OFL) v1.1 (http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL), which allows you to copy, modify, and redistribute them if you need to. All of the above fonts are published under the SIL Open Font License (OFL) v1.1 (http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL), which allows you to copy, modify, and redistribute them if you need to.
FreeMono.ttf is licensed under GPLv3, with the GPL font exception.
OpenSansCondensed-LightItalic.tt, from https://fonts.google.com/specimen/Open+Sans, under Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0) OpenSansCondensed-LightItalic.tt, from https://fonts.google.com/specimen/Open+Sans, under Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
DejaVuSans-24-{1,2,4,8}-stripped.ttf are based on DejaVuSans.ttf converted using FontForge to add bitmap strikes and keep only the ASCII range. DejaVuSans-24-{1,2,4,8}-stripped.ttf are based on DejaVuSans.ttf converted using FontForge to add bitmap strikes and keep only the ASCII range.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

View File

@ -12,6 +12,8 @@ TEST_FILE_DXT3 = "Tests/images/dxt3-argb-8bbp-explicitalpha_MipMaps-1.dds"
TEST_FILE_DXT5 = "Tests/images/dxt5-argb-8bbp-interpolatedalpha_MipMaps-1.dds" TEST_FILE_DXT5 = "Tests/images/dxt5-argb-8bbp-interpolatedalpha_MipMaps-1.dds"
TEST_FILE_DX10_BC7 = "Tests/images/bc7-argb-8bpp_MipMaps-1.dds" TEST_FILE_DX10_BC7 = "Tests/images/bc7-argb-8bpp_MipMaps-1.dds"
TEST_FILE_DX10_BC7_UNORM_SRGB = "Tests/images/DXGI_FORMAT_BC7_UNORM_SRGB.dds" TEST_FILE_DX10_BC7_UNORM_SRGB = "Tests/images/DXGI_FORMAT_BC7_UNORM_SRGB.dds"
TEST_FILE_DX10_R8G8B8A8 = "Tests/images/argb-32bpp_MipMaps-1.dds"
TEST_FILE_DX10_R8G8B8A8_UNORM_SRGB = "Tests/images/DXGI_FORMAT_R8G8B8A8_UNORM_SRGB.dds"
TEST_FILE_UNCOMPRESSED_RGB = "Tests/images/uncompressed_rgb.dds" TEST_FILE_UNCOMPRESSED_RGB = "Tests/images/uncompressed_rgb.dds"
@ -88,6 +90,37 @@ def test_dx10_bc7_unorm_srgb():
assert_image_equal(target, im) assert_image_equal(target, im)
def test_dx10_r8g8b8a8():
"""Check DX10 images can be opened"""
with Image.open(TEST_FILE_DX10_R8G8B8A8) as im:
im.load()
assert im.format == "DDS"
assert im.mode == "RGBA"
assert im.size == (256, 256)
with Image.open(TEST_FILE_DX10_R8G8B8A8.replace(".dds", ".png")) as target:
assert_image_equal(target, im)
def test_dx10_r8g8b8a8_unorm_srgb():
"""Check DX10 unsigned normalized integer images can be opened"""
with Image.open(TEST_FILE_DX10_R8G8B8A8_UNORM_SRGB) as im:
im.load()
assert im.format == "DDS"
assert im.mode == "RGBA"
assert im.size == (16, 16)
assert im.info["gamma"] == 1 / 2.2
with Image.open(
TEST_FILE_DX10_R8G8B8A8_UNORM_SRGB.replace(".dds", ".png")
) as target:
assert_image_equal(target, im)
def test_unimplemented_dxgi_format(): def test_unimplemented_dxgi_format():
with pytest.raises(NotImplementedError): with pytest.raises(NotImplementedError):
Image.open("Tests/images/unimplemented_dxgi_format.dds") Image.open("Tests/images/unimplemented_dxgi_format.dds")

View File

@ -598,6 +598,10 @@ class TestFileTiff:
# Ignore this UserWarning which triggers for four tags: # Ignore this UserWarning which triggers for four tags:
# "Possibly corrupt EXIF data. Expecting to read 50404352 bytes but..." # "Possibly corrupt EXIF data. Expecting to read 50404352 bytes but..."
@pytest.mark.filterwarnings("ignore:Possibly corrupt EXIF data") @pytest.mark.filterwarnings("ignore:Possibly corrupt EXIF data")
@pytest.mark.skipif(
not os.path.exists("Tests/images/string_dimension.tiff"),
reason="Extra image files not installed",
)
def test_string_dimension(self): def test_string_dimension(self):
# Assert that an error is raised if one of the dimensions is a string # Assert that an error is raised if one of the dimensions is a string
with pytest.raises(ValueError): with pytest.raises(ValueError):

View File

@ -21,7 +21,7 @@ def test_libimagequant_quantize():
image = hopper() image = hopper()
try: try:
converted = image.quantize(100, Image.LIBIMAGEQUANT) converted = image.quantize(100, Image.LIBIMAGEQUANT)
except ValueError as ex: except ValueError as ex: # pragma: no cover
if "dependency" in str(ex).lower(): if "dependency" in str(ex).lower():
pytest.skip("libimagequant support not available") pytest.skip("libimagequant support not available")
else: else:

View File

@ -35,30 +35,8 @@ class TestImageFont:
# Freetype has different metrics depending on the version. # Freetype has different metrics depending on the version.
# (and, other things, but first things first) # (and, other things, but first things first)
METRICS = { METRICS = {
(">=2.3", "<2.4"): { (">=2.7",): {"multiline": 6.2, "textsize": 2.5, "getlength": (36, 21, 24, 33)},
"multiline": 30, "Default": {"multiline": 0.5, "textsize": 0.5, "getlength": (36, 24, 24, 33)},
"textsize": 12,
"getters": (13, 16),
"mask": (107, 13),
"multiline-anchor": 6,
"getlength": (36, 27, 27, 33),
},
(">=2.7",): {
"multiline": 6.2,
"textsize": 2.5,
"getters": (12, 16),
"mask": (108, 13),
"multiline-anchor": 4,
"getlength": (36, 21, 24, 33),
},
"Default": {
"multiline": 0.5,
"textsize": 0.5,
"getters": (12, 16),
"mask": (108, 13),
"multiline-anchor": 4,
"getlength": (36, 24, 24, 33),
},
} }
@classmethod @classmethod
@ -395,7 +373,7 @@ class TestImageFont:
mask = transposed_font.getmask(text) mask = transposed_font.getmask(text)
# Assert # Assert
assert mask.size == self.metrics["mask"][::-1] assert mask.size == (13, 108)
def test_unrotated_transposed_font_get_mask(self): def test_unrotated_transposed_font_get_mask(self):
# Arrange # Arrange
@ -408,7 +386,7 @@ class TestImageFont:
mask = transposed_font.getmask(text) mask = transposed_font.getmask(text)
# Assert # Assert
assert mask.size == self.metrics["mask"] assert mask.size == (108, 13)
def test_free_type_font_get_name(self): def test_free_type_font_get_name(self):
# Arrange # Arrange
@ -452,7 +430,7 @@ class TestImageFont:
mask = font.getmask(text) mask = font.getmask(text)
# Assert # Assert
assert mask.size == self.metrics["mask"] assert mask.size == (108, 13)
def test_load_path_not_found(self): def test_load_path_not_found(self):
# Arrange # Arrange
@ -633,7 +611,7 @@ class TestImageFont:
assert t.font.glyphs == 4177 assert t.font.glyphs == 4177
assert t.getsize("A") == (12, 16) assert t.getsize("A") == (12, 16)
assert t.getsize("AB") == (24, 16) assert t.getsize("AB") == (24, 16)
assert t.getsize("M") == self.metrics["getters"] assert t.getsize("M") == (12, 16)
assert t.getsize("y") == (12, 20) assert t.getsize("y") == (12, 20)
assert t.getsize("a") == (12, 16) assert t.getsize("a") == (12, 16)
assert t.getsize_multiline("A") == (12, 16) assert t.getsize_multiline("A") == (12, 16)
@ -869,7 +847,7 @@ class TestImageFont:
) )
with Image.open(target) as expected: with Image.open(target) as expected:
assert_image_similar(im, expected, self.metrics["multiline-anchor"]) assert_image_similar(im, expected, 4)
def test_anchor_invalid(self): def test_anchor_invalid(self):
font = self.get_font() font = self.get_font()

View File

@ -5,4 +5,4 @@ git fetch origin master:refs/remotes/origin/master
# CFLAGS=-O0 means build with no optimisation. # CFLAGS=-O0 means build with no optimisation.
# Makes build much quicker for lxml and other dependencies. # Makes build much quicker for lxml and other dependencies.
time CFLAGS=-O0 pip install diff_cover time CFLAGS=-O0 python3 -m pip install diff_cover

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# install libimagequant # install libimagequant
archive=libimagequant-2.12.6 archive=libimagequant-2.13.1
./download-and-extract.sh $archive https://raw.githubusercontent.com/python-pillow/pillow-depends/master/$archive.tar.gz ./download-and-extract.sh $archive https://raw.githubusercontent.com/python-pillow/pillow-depends/master/$archive.tar.gz

View File

@ -2,7 +2,7 @@
# install raqm # install raqm
archive=raqm-0.7.0 archive=raqm-0.7.1
./download-and-extract.sh $archive https://raw.githubusercontent.com/python-pillow/pillow-depends/master/$archive.tar.gz ./download-and-extract.sh $archive https://raw.githubusercontent.com/python-pillow/pillow-depends/master/$archive.tar.gz

View File

@ -10,7 +10,7 @@ The fork author's goal is to foster and support active development of PIL throug
- Publicized development activity on `GitHub`_ - Publicized development activity on `GitHub`_
- Regular releases to the `Python Package Index`_ - Regular releases to the `Python Package Index`_
.. _Travis CI: https://travis-ci.org/python-pillow/Pillow .. _Travis CI: https://travis-ci.com/github/python-pillow/Pillow
.. _AppVeyor: https://ci.appveyor.com/project/Python-pillow/pillow .. _AppVeyor: https://ci.appveyor.com/project/Python-pillow/pillow
.. _GitHub Actions: https://github.com/python-pillow/Pillow/actions .. _GitHub Actions: https://github.com/python-pillow/Pillow/actions
.. _GitHub: https://github.com/python-pillow/Pillow .. _GitHub: https://github.com/python-pillow/Pillow
@ -19,7 +19,7 @@ The fork author's goal is to foster and support active development of PIL throug
License License
------- -------
Like PIL, Pillow is `licensed under the open source PIL Software License <https://raw.githubusercontent.com/python-pillow/Pillow/master/LICENSE>`_ Like PIL, Pillow is `licensed under the open source HPND License <https://raw.githubusercontent.com/python-pillow/Pillow/master/LICENSE>`_
Why a fork? Why a fork?
----------- -----------

View File

@ -143,7 +143,7 @@ html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# The name of an image file (relative to this directory) to place at the top # The name of an image file (relative to this directory) to place at the top
# of the sidebar. # of the sidebar.
# html_logo = None html_logo = "resources/pillow-logo.png"
# The name of an image file (within the static path) to use as favicon of the # The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32

View File

@ -125,7 +125,7 @@ following options are available::
**append_images** **append_images**
A list of images to append as additional frames. Each of the A list of images to append as additional frames. Each of the
images in the list can be single or multiframe images. images in the list can be single or multiframe images.
This is currently supported for GIF, PDF, TIFF, and WebP. This is currently supported for GIF, PDF, PNG, TIFF, and WebP.
It is also supported for ICNS. If images are passed in of relevant sizes, It is also supported for ICNS. If images are passed in of relevant sizes,
they will be used instead of scaling down the main image. they will be used instead of scaling down the main image.
@ -561,8 +561,8 @@ The :py:meth:`~PIL.Image.Image.save` method supports the following options:
.. note:: .. note::
To enable PNG support, you need to build and install the ZLIB compression To enable PNG support, you need to build and install the ZLIB compression
library before building the Python Imaging Library. See the `installation library before building the Python Imaging Library. See the
documentation <../installation.html>`_ for details. :doc:`installation documentation <../installation>` for details.
.. _apng-sequences: .. _apng-sequences:
@ -947,9 +947,10 @@ Saving sequences
library is v0.5.0 or later. You can check webp animation support at library is v0.5.0 or later. You can check webp animation support at
runtime by calling ``features.check("webp_anim")``. runtime by calling ``features.check("webp_anim")``.
When calling :py:meth:`~PIL.Image.Image.save` to write a WebP file, the When calling :py:meth:`~PIL.Image.Image.save` to write a WebP file, by default
following options are available when the ``save_all`` argument is present and only the first frame of a multiframe image will be saved. If the ``save_all``
true. argument is present and true, then all frames will be saved, and the following
options will also be available.
**append_images** **append_images**
A list of images to append as additional frames. Each of the A list of images to append as additional frames. Each of the

View File

@ -157,7 +157,7 @@ The raw decoder
The ``raw`` decoder is used to read uncompressed data from an image file. It The ``raw`` decoder is used to read uncompressed data from an image file. It
can be used with most uncompressed file formats, such as PPM, BMP, uncompressed can be used with most uncompressed file formats, such as PPM, BMP, uncompressed
TIFF, and many others. To use the raw decoder with the TIFF, and many others. To use the raw decoder with the
:py:func:`PIL.Image.frombytes` function, use the following syntax:: :py:func:`PIL.Image.frombytes` function, use the following syntax:
.. code-block:: python .. code-block:: python

View File

@ -9,12 +9,12 @@ Pillow for enterprise is available via the Tidelift Subscription. `Learn more <h
:target: https://pillow.readthedocs.io/?badge=latest :target: https://pillow.readthedocs.io/?badge=latest
:alt: Documentation Status :alt: Documentation Status
.. image:: https://img.shields.io/travis/python-pillow/Pillow/master.svg?label=Linux%20build .. image:: https://img.shields.io/travis/com/python-pillow/Pillow/master.svg?label=Linux%20build
:target: https://travis-ci.org/python-pillow/Pillow :target: https://travis-ci.com/github/python-pillow/Pillow
:alt: Travis CI build status (Linux) :alt: Travis CI build status (Linux)
.. image:: https://img.shields.io/travis/python-pillow/pillow-wheels/master.svg?label=macOS%20build .. image:: https://img.shields.io/travis/com/python-pillow/pillow-wheels/master.svg?label=macOS%20build
:target: https://travis-ci.org/python-pillow/pillow-wheels :target: https://travis-ci.com/github/python-pillow/pillow-wheels
:alt: Travis CI build status (macOS) :alt: Travis CI build status (macOS)
.. image:: https://img.shields.io/appveyor/build/python-pillow/Pillow/master.svg?label=Windows%20build .. image:: https://img.shields.io/appveyor/build/python-pillow/Pillow/master.svg?label=Windows%20build

View File

@ -177,7 +177,7 @@ Many of Pillow's features require external libraries:
* **libimagequant** provides improved color quantization * **libimagequant** provides improved color quantization
* Pillow has been tested with libimagequant **2.6-2.12.6** * Pillow has been tested with libimagequant **2.6-2.13.1**
* Libimagequant is licensed GPLv3, which is more restrictive than * Libimagequant is licensed GPLv3, which is more restrictive than
the Pillow license, therefore we will not be distributing binaries the Pillow license, therefore we will not be distributing binaries
with libimagequant support enabled. with libimagequant support enabled.
@ -422,33 +422,27 @@ These platforms are built and tested for every change.
+----------------------------------+--------------------------+-----------------------+ +----------------------------------+--------------------------+-----------------------+
| Arch | 3.8 |x86-64 | | Arch | 3.8 |x86-64 |
+----------------------------------+--------------------------+-----------------------+ +----------------------------------+--------------------------+-----------------------+
| Amazon Linux 1 | 3.6 |x86-64 |
+----------------------------------+--------------------------+-----------------------+
| Amazon Linux 2 | 3.7 |x86-64 | | Amazon Linux 2 | 3.7 |x86-64 |
+----------------------------------+--------------------------+-----------------------+ +----------------------------------+--------------------------+-----------------------+
| CentOS 6 | 3.6 |x86-64 |
+----------------------------------+--------------------------+-----------------------+
| CentOS 7 | 3.6 |x86-64 | | CentOS 7 | 3.6 |x86-64 |
+----------------------------------+--------------------------+-----------------------+ +----------------------------------+--------------------------+-----------------------+
| CentOS 8 | 3.6 |x86-64 | | CentOS 8 | 3.6 |x86-64 |
+----------------------------------+--------------------------+-----------------------+ +----------------------------------+--------------------------+-----------------------+
| Debian 10 Buster | 3.7 |x86 | | Debian 10 Buster | 3.7 |x86 |
+----------------------------------+--------------------------+-----------------------+ +----------------------------------+--------------------------+-----------------------+
| Fedora 31 | 3.7 |x86-64 |
+----------------------------------+--------------------------+-----------------------+
| Fedora 32 | 3.8 |x86-64 | | Fedora 32 | 3.8 |x86-64 |
+----------------------------------+--------------------------+-----------------------+ +----------------------------------+--------------------------+-----------------------+
| Fedora 33 | 3.9 |x86-64 |
+----------------------------------+--------------------------+-----------------------+
| macOS 10.15 Catalina | 3.6, 3.7, 3.8, 3.9, PyPy3|x86-64 | | macOS 10.15 Catalina | 3.6, 3.7, 3.8, 3.9, PyPy3|x86-64 |
+----------------------------------+--------------------------+-----------------------+ +----------------------------------+--------------------------+-----------------------+
| Ubuntu Linux 16.04 LTS (Xenial) | 3.6, 3.7, 3.8, PyPy3 |x86-64 | | Ubuntu Linux 16.04 LTS (Xenial) | 3.6, 3.7, 3.8, 3.9, PyPy3|x86-64 |
+----------------------------------+--------------------------+-----------------------+ +----------------------------------+--------------------------+-----------------------+
| Ubuntu Linux 18.04 LTS (Bionic) | 3.6, 3.7, 3.8, 3.9, PyPy3|x86-64 | | Ubuntu Linux 18.04 LTS (Bionic) | 3.6, 3.7, 3.8, 3.9, PyPy3|x86-64 |
+----------------------------------+--------------------------+-----------------------+ +----------------------------------+--------------------------+-----------------------+
| Ubuntu Linux 20.04 LTS (Focal) | 3.8 |x86-64 | | Ubuntu Linux 20.04 LTS (Focal) | 3.8 |x86-64 |
+----------------------------------+--------------------------+-----------------------+ +----------------------------------+--------------------------+-----------------------+
| Windows Server 2016 | 3.8 |x86 | | Windows Server 2016 | 3.6 |x86-64 |
| +--------------------------+-----------------------+
| | 3.6 |x86-64 |
+----------------------------------+--------------------------+-----------------------+ +----------------------------------+--------------------------+-----------------------+
| Windows Server 2019 | 3.6, 3.7, 3.8, 3.9 |x86, x86-64 | | Windows Server 2019 | 3.6, 3.7, 3.8, 3.9 |x86, x86-64 |
| +--------------------------+-----------------------+ | +--------------------------+-----------------------+
@ -471,7 +465,11 @@ These platforms have been reported to work at the versions mentioned.
+----------------------------------+------------------------------+--------------------------------+-----------------------+ +----------------------------------+------------------------------+--------------------------------+-----------------------+
|**Operating system** |**Tested Python versions** |**Latest tested Pillow version**|**Tested processors** | |**Operating system** |**Tested Python versions** |**Latest tested Pillow version**|**Tested processors** |
+----------------------------------+------------------------------+--------------------------------+-----------------------+ +----------------------------------+------------------------------+--------------------------------+-----------------------+
| macOS 10.15 Catalina | 3.5, 3.6, 3.7, 3.8 | 7.2.0 |x86-64 | | macOS 11.0 Big Sur | 3.6, 3.7, 3.8, 3.9 | 8.0.1 |x86-64 |
+----------------------------------+------------------------------+--------------------------------+-----------------------+
| macOS 10.15 Catalina | 3.6, 3.7, 3.8, 3.9 | 8.0.1 |x86-64 |
| +------------------------------+--------------------------------+ +
| | 3.5 | 7.2.0 | |
+----------------------------------+------------------------------+--------------------------------+-----------------------+ +----------------------------------+------------------------------+--------------------------------+-----------------------+
| macOS 10.14 Mojave | 3.5, 3.6, 3.7, 3.8 | 7.2.0 |x86-64 | | macOS 10.14 Mojave | 3.5, 3.6, 3.7, 3.8 | 7.2.0 |x86-64 |
| +------------------------------+--------------------------------+ + | +------------------------------+--------------------------------+ +

View File

@ -296,7 +296,7 @@ Methods
Draws the string at the given position. Draws the string at the given position.
:param xy: The anchor coordinates of the text. :param xy: The anchor coordinates of the text.
:param text: Text to be drawn. If it contains any newline characters, :param text: String to be drawn. If it contains any newline characters,
the text is passed on to the text is passed on to
:py:meth:`~PIL.ImageDraw.ImageDraw.multiline_text`. :py:meth:`~PIL.ImageDraw.ImageDraw.multiline_text`.
:param fill: Color to use for the text. :param fill: Color to use for the text.
@ -362,7 +362,7 @@ Methods
Draws the string at the given position. Draws the string at the given position.
:param xy: The anchor coordinates of the text. :param xy: The anchor coordinates of the text.
:param text: Text to be drawn. :param text: String to be drawn.
:param fill: Color to use for the text. :param fill: Color to use for the text.
:param font: An :py:class:`~PIL.ImageFont.ImageFont` instance. :param font: An :py:class:`~PIL.ImageFont.ImageFont` instance.

View File

@ -8,10 +8,10 @@ The :py:mod:`~PIL.ImageFont` module defines a class with the same name. Instance
this class store bitmap fonts, and are used with the this class store bitmap fonts, and are used with the
:py:meth:`PIL.ImageDraw.ImageDraw.text` method. :py:meth:`PIL.ImageDraw.ImageDraw.text` method.
PIL uses its own font file format to store bitmap fonts. You can use the PIL uses its own font file format to store bitmap fonts. You can use
:command:`pilfont` utility from `pilfont.py <https://github.com/python-pillow/pillow-scripts/blob/master/Scripts/pilfont.py>`_
`pillow-scripts <https://pypi.org/project/pillow-scripts/>`_ from `pillow-scripts <https://pypi.org/project/pillow-scripts/>`_ to convert BDF and
to convert BDF and PCF font descriptors (X window font formats) to this format. PCF font descriptors (X window font formats) to this format.
Starting with version 1.1.4, PIL can be configured to support TrueType and Starting with version 1.1.4, PIL can be configured to support TrueType and
OpenType fonts (as well as other font formats supported by the FreeType OpenType fonts (as well as other font formats supported by the FreeType

View File

@ -6,10 +6,9 @@ Added Complex Text Rendering
Pillow now supports complex text rendering for scripts requiring glyph Pillow now supports complex text rendering for scripts requiring glyph
composition and bidirectional flow. This optional feature adds three composition and bidirectional flow. This optional feature adds three
dependencies: harfbuzz, fribidi, and raqm. See the `install dependencies: harfbuzz, fribidi, and raqm. See the :doc:`install documentation
documentation <../installation.html>`_ for further details. This feature is <../installation>` for further details. This feature is tested and works on
tested and works on Unix and Mac, but has not yet been built on Windows Unix and Mac, but has not yet been built on Windows platforms.
platforms.
New Optional Parameters New Optional Parameters
======================= =======================

View File

@ -17,7 +17,7 @@ Removed deprecated PIL.OleFileIO
PIL.OleFileIO was removed as a vendored file and in Pillow 4.0.0 (2017-01) in favour of PIL.OleFileIO was removed as a vendored file and in Pillow 4.0.0 (2017-01) in favour of
the upstream olefile Python package, and replaced with an ``ImportError``. The the upstream olefile Python package, and replaced with an ``ImportError``. The
deprecated file has now been removed from Pillow. If needed, install from PyPI (eg. deprecated file has now been removed from Pillow. If needed, install from PyPI (eg.
``pip install olefile``). ``python3 -m pip install olefile``).
Removed deprecated ImageOps functions Removed deprecated ImageOps functions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -0,0 +1,25 @@
8.0.1
-----
Security
========
Update FreeType used in binary wheels to `2.10.4`_ to fix CVE-2020-15999_:
- A heap buffer overflow has been found in the handling of embedded PNG bitmaps,
introduced in FreeType version 2.6.
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15999
If you use option ``FT_CONFIG_OPTION_USE_PNG`` you should upgrade immediately.
We strongly recommend updating to Pillow 8.0.1 if you are using Pillow 8.0.0, which improved support for bitmap fonts.
In Pillow 7.2.0 and earlier bitmap fonts were disabled with ``FT_LOAD_NO_BITMAP``, but it is not
clear if this prevents the exploit and we recommend updating to Pillow 8.0.1.
Pillow 8.0.0 and earlier are potentially vulnerable releases, including the last release
to support Python 2.7, namely Pillow 6.2.2.
.. _2.10.4: https://sourceforge.net/projects/freetype/files/freetype2/2.10.4/
.. _CVE-2020-15999: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15999

View File

@ -13,6 +13,7 @@ expected to be backported to earlier versions.
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
8.0.1
8.0.0 8.0.0
7.2.0 7.2.0
7.1.2 7.1.2

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -38,13 +38,17 @@ ZLIB_ROOT = None
if sys.platform == "win32" and sys.version_info >= (3, 10): if sys.platform == "win32" and sys.version_info >= (3, 10):
warnings.warn( import atexit
atexit.register(
lambda: warnings.warn(
f"Pillow {PILLOW_VERSION} does not support Python " f"Pillow {PILLOW_VERSION} does not support Python "
f"{sys.version_info.major}.{sys.version_info.minor} and does not provide " f"{sys.version_info.major}.{sys.version_info.minor} and does not provide "
"prebuilt Windows binaries. We do not recommend building from source on " "prebuilt Windows binaries. We do not recommend building from source on "
"Windows.", "Windows.",
RuntimeWarning, RuntimeWarning,
) )
)
_IMAGING = ("decode", "encode", "map", "display", "outline", "path") _IMAGING = ("decode", "encode", "map", "display", "outline", "path")

View File

@ -94,6 +94,9 @@ DXT5_FOURCC = 0x35545844
# dxgiformat.h # dxgiformat.h
DXGI_FORMAT_R8G8B8A8_TYPELESS = 27
DXGI_FORMAT_R8G8B8A8_UNORM = 28
DXGI_FORMAT_R8G8B8A8_UNORM_SRGB = 29
DXGI_FORMAT_BC7_TYPELESS = 97 DXGI_FORMAT_BC7_TYPELESS = 97
DXGI_FORMAT_BC7_UNORM = 98 DXGI_FORMAT_BC7_UNORM = 98
DXGI_FORMAT_BC7_UNORM_SRGB = 99 DXGI_FORMAT_BC7_UNORM_SRGB = 99
@ -157,6 +160,15 @@ class DdsImageFile(ImageFile.ImageFile):
self.pixel_format = "BC7" self.pixel_format = "BC7"
self.info["gamma"] = 1 / 2.2 self.info["gamma"] = 1 / 2.2
n = 7 n = 7
elif dxgi_format in (
DXGI_FORMAT_R8G8B8A8_TYPELESS,
DXGI_FORMAT_R8G8B8A8_UNORM,
DXGI_FORMAT_R8G8B8A8_UNORM_SRGB,
):
self.tile = [("raw", (0, 0) + self.size, 0, ("RGBA", 0, 1))]
if dxgi_format == DXGI_FORMAT_R8G8B8A8_UNORM_SRGB:
self.info["gamma"] = 1 / 2.2
return
else: else:
raise NotImplementedError( raise NotImplementedError(
f"Unimplemented DXGI format {dxgi_format}" f"Unimplemented DXGI format {dxgi_format}"

View File

@ -2905,6 +2905,8 @@ def open(fp, mode="r", formats=None):
def _open_core(fp, filename, prefix, formats): def _open_core(fp, filename, prefix, formats):
for i in formats: for i in formats:
if i not in OPEN:
init()
try: try:
factory, accept = OPEN[i] factory, accept = OPEN[i]
result = not accept or accept(prefix) result = not accept or accept(prefix)

View File

@ -285,7 +285,7 @@ class FreeTypeFont:
the font which language the text is in, and to apply the the font which language the text is in, and to apply the
correct substitutions as appropriate, if available. correct substitutions as appropriate, if available.
It should be a `BCP 47 language code It should be a `BCP 47 language code
<https://www.w3.org/International/articles/language-tags/>` <https://www.w3.org/International/articles/language-tags/>`_
Requires libraqm. Requires libraqm.
:return: Width for horizontal, height for vertical text. :return: Width for horizontal, height for vertical text.
@ -338,7 +338,7 @@ class FreeTypeFont:
the font which language the text is in, and to apply the the font which language the text is in, and to apply the
correct substitutions as appropriate, if available. correct substitutions as appropriate, if available.
It should be a `BCP 47 language code It should be a `BCP 47 language code
<https://www.w3.org/International/articles/language-tags/>` <https://www.w3.org/International/articles/language-tags/>`_
Requires libraqm. Requires libraqm.
:param stroke_width: The width of the text stroke. :param stroke_width: The width of the text stroke.
@ -398,7 +398,7 @@ class FreeTypeFont:
the font which language the text is in, and to apply the the font which language the text is in, and to apply the
correct substitutions as appropriate, if available. correct substitutions as appropriate, if available.
It should be a `BCP 47 language code It should be a `BCP 47 language code
<https://www.w3.org/International/articles/language-tags/>` <https://www.w3.org/International/articles/language-tags/>`_
Requires libraqm. Requires libraqm.
.. versionadded:: 6.0.0 .. versionadded:: 6.0.0
@ -455,7 +455,7 @@ class FreeTypeFont:
the font which language the text is in, and to apply the the font which language the text is in, and to apply the
correct substitutions as appropriate, if available. correct substitutions as appropriate, if available.
It should be a `BCP 47 language code It should be a `BCP 47 language code
<https://www.w3.org/International/articles/language-tags/>` <https://www.w3.org/International/articles/language-tags/>`_
Requires libraqm. Requires libraqm.
.. versionadded:: 6.0.0 .. versionadded:: 6.0.0
@ -539,7 +539,7 @@ class FreeTypeFont:
the font which language the text is in, and to apply the the font which language the text is in, and to apply the
correct substitutions as appropriate, if available. correct substitutions as appropriate, if available.
It should be a `BCP 47 language code It should be a `BCP 47 language code
<https://www.w3.org/International/articles/language-tags/>` <https://www.w3.org/International/articles/language-tags/>`_
Requires libraqm. Requires libraqm.
.. versionadded:: 6.0.0 .. versionadded:: 6.0.0
@ -625,7 +625,7 @@ class FreeTypeFont:
the font which language the text is in, and to apply the the font which language the text is in, and to apply the
correct substitutions as appropriate, if available. correct substitutions as appropriate, if available.
It should be a `BCP 47 language code It should be a `BCP 47 language code
<https://www.w3.org/International/articles/language-tags/>` <https://www.w3.org/International/articles/language-tags/>`_
Requires libraqm. Requires libraqm.
.. versionadded:: 6.0.0 .. versionadded:: 6.0.0

View File

@ -22,7 +22,7 @@
* See the README file for information on usage and redistribution. * See the README file for information on usage and redistribution.
*/ */
#define PY_SSIZE_T_CLEAN
#include "Python.h" #include "Python.h"
#include "libImaging/Imaging.h" #include "libImaging/Imaging.h"
@ -196,7 +196,7 @@ static PyObject*
_frombytes(ImagingDisplayObject* display, PyObject* args) _frombytes(ImagingDisplayObject* display, PyObject* args)
{ {
char* ptr; char* ptr;
int bytes; Py_ssize_t bytes;
if (!PyArg_ParseTuple(args, "y#:frombytes", &ptr, &bytes)) { if (!PyArg_ParseTuple(args, "y#:frombytes", &ptr, &bytes)) {
return NULL; return NULL;
@ -234,8 +234,6 @@ static struct PyMethodDef methods[] = {
{"releasedc", (PyCFunction)_releasedc, 1}, {"releasedc", (PyCFunction)_releasedc, 1},
{"frombytes", (PyCFunction)_frombytes, 1}, {"frombytes", (PyCFunction)_frombytes, 1},
{"tobytes", (PyCFunction)_tobytes, 1}, {"tobytes", (PyCFunction)_tobytes, 1},
{"fromstring", (PyCFunction)_frombytes, 1},
{"tostring", (PyCFunction)_tobytes, 1},
{NULL, NULL} /* sentinel */ {NULL, NULL} /* sentinel */
}; };
@ -777,7 +775,7 @@ PyImaging_DrawWmf(PyObject* self, PyObject* args)
char* ptr; char* ptr;
char* data; char* data;
int datasize; Py_ssize_t datasize;
int width, height; int width, height;
int x0, y0, x1, y1; int x0, y0, x1, y1;
if (!PyArg_ParseTuple(args, "y#(ii)(iiii):_load", &data, &datasize, if (!PyArg_ParseTuple(args, "y#(ii)(iiii):_load", &data, &datasize,

View File

@ -1,7 +1,7 @@
# Tox (https://tox.readthedocs.io/en/latest/) is a tool for running tests # Tox (https://tox.readthedocs.io/en/latest/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the # in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox" # test suite on all supported python versions. To use it,
# and then run "tox" from this directory. # "python3 -m pip install tox" and then run "tox" from this directory.
[tox] [tox]
envlist = envlist =

View File

@ -82,7 +82,7 @@ Pillow for the selected version of Python.
instead of installing Pillow. instead of installing Pillow.
You can also use ``winbuild\build\build_pillow.cmd --inplace develop`` to build You can also use ``winbuild\build\build_pillow.cmd --inplace develop`` to build
and install Pillow in develop mode (instead of ``pip install --editable``). and install Pillow in develop mode (instead of ``python3 -m pip install --editable``).
Testing Pillow Testing Pillow
-------------- --------------

View File

@ -105,9 +105,9 @@ header = [
# dependencies, listed in order of compilation # dependencies, listed in order of compilation
deps = { deps = {
"libjpeg": { "libjpeg": {
"url": SF_MIRROR + "/project/libjpeg-turbo/2.0.5/libjpeg-turbo-2.0.5.tar.gz", "url": SF_MIRROR + "/project/libjpeg-turbo/2.0.6/libjpeg-turbo-2.0.6.tar.gz",
"filename": "libjpeg-turbo-2.0.5.tar.gz", "filename": "libjpeg-turbo-2.0.6.tar.gz",
"dir": "libjpeg-turbo-2.0.5", "dir": "libjpeg-turbo-2.0.6",
"build": [ "build": [
cmd_cmake( cmd_cmake(
[ [
@ -184,9 +184,9 @@ deps = {
"libs": [r"libpng16.lib"], "libs": [r"libpng16.lib"],
}, },
"freetype": { "freetype": {
"url": "https://download.savannah.gnu.org/releases/freetype/freetype-2.10.3.tar.gz", # noqa: E501 "url": "https://download.savannah.gnu.org/releases/freetype/freetype-2.10.4.tar.gz", # noqa: E501
"filename": "freetype-2.10.3.tar.gz", "filename": "freetype-2.10.4.tar.gz",
"dir": "freetype-2.10.3", "dir": "freetype-2.10.4",
"patch": { "patch": {
r"builds\windows\vc2010\freetype.vcxproj": { r"builds\windows\vc2010\freetype.vcxproj": {
# freetype setting is /MD for .dll and /MT for .lib, we need /MD # freetype setting is /MD for .dll and /MT for .lib, we need /MD
@ -287,9 +287,9 @@ deps = {
"libs": [r"*.lib"], "libs": [r"*.lib"],
}, },
"fribidi": { "fribidi": {
"url": "https://github.com/fribidi/fribidi/archive/v1.0.9.zip", "url": "https://github.com/fribidi/fribidi/archive/v1.0.10.zip",
"filename": "fribidi-1.0.9.zip", "filename": "fribidi-1.0.10.zip",
"dir": "fribidi-1.0.9", "dir": "fribidi-1.0.10",
"build": [ "build": [
cmd_copy(r"{winbuild_dir}\fribidi.cmake", r"CMakeLists.txt"), cmd_copy(r"{winbuild_dir}\fribidi.cmake", r"CMakeLists.txt"),
cmd_cmake(), cmd_cmake(),
@ -300,9 +300,9 @@ deps = {
"libs": [r"*.lib"], "libs": [r"*.lib"],
}, },
"libraqm": { "libraqm": {
"url": "https://github.com/HOST-Oman/libraqm/archive/v0.7.0.zip", "url": "https://github.com/HOST-Oman/libraqm/archive/v0.7.1.zip",
"filename": "libraqm-0.7.0.zip", "filename": "libraqm-0.7.1.zip",
"dir": "libraqm-0.7.0", "dir": "libraqm-0.7.1",
"build": [ "build": [
cmd_copy(r"{winbuild_dir}\raqm.cmake", r"CMakeLists.txt"), cmd_copy(r"{winbuild_dir}\raqm.cmake", r"CMakeLists.txt"),
cmd_cmake(), cmd_cmake(),

View File

@ -99,4 +99,4 @@ add_library(fribidi STATIC
${FRIBIDI_SOURCES_GENERATED}) ${FRIBIDI_SOURCES_GENERATED})
fribidi_definitions(fribidi) fribidi_definitions(fribidi)
target_compile_definitions(fribidi target_compile_definitions(fribidi
PUBLIC -DFRIBIDI_ENTRY=extern) PUBLIC -DFRIBIDI_LIB_STATIC)

View File

@ -7,7 +7,7 @@ find_library(fribidi NAMES fribidi)
find_library(harfbuzz NAMES harfbuzz) find_library(harfbuzz NAMES harfbuzz)
find_library(freetype NAMES freetype) find_library(freetype NAMES freetype)
add_definitions(-DFRIBIDI_ENTRY=extern) add_definitions(-DFRIBIDI_LIB_STATIC)
function(raqm_conf) function(raqm_conf)