Skip to content

Commit

Permalink
Merge branch 'python-pillow:main' into eps_plugin_perf
Browse files Browse the repository at this point in the history
  • Loading branch information
Yay295 committed Mar 29, 2023
2 parents 281cbc2 + e945437 commit b8b153f
Show file tree
Hide file tree
Showing 115 changed files with 1,397 additions and 614 deletions.
4 changes: 2 additions & 2 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ install:
- mv c:\pillow-depends-main c:\pillow-depends
- xcopy /S /Y c:\test-images-main\* c:\pillow\tests\images
- 7z x ..\pillow-depends\nasm-2.15.05-win64.zip -oc:\
- ..\pillow-depends\gs1000w32.exe /S
- path c:\nasm-2.15.05;C:\Program Files (x86)\gs\gs10.0.0\bin;%PATH%
- choco install ghostscript --version=10.0.0.20230317
- path c:\nasm-2.15.05;C:\Program Files\gs\gs10.00.0\bin;%PATH%
- cd c:\pillow\winbuild\
- ps: |
c:\python37\python.exe c:\pillow\winbuild\build_prepare.py -v --depends=C:\pillow-depends\
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/cifuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@ name: CIFuzz
on:
push:
paths:
- ".github/workflows/cifuzz.yml"
- "**.c"
- "**.h"
pull_request:
paths:
- ".github/workflows/cifuzz.yml"
- "**.c"
- "**.h"
workflow_dispatch:

permissions:
contents: read

concurrency:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Docs

on:
push:
paths:
- ".github/workflows/docs.yml"
- "docs/**"
pull_request:
paths:
- ".github/workflows/docs.yml"
- "docs/**"
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
FORCE_COLOR: 1

jobs:
build:

runs-on: ubuntu-latest
name: Docs

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
cache: pip
cache-dependency-path: ".ci/*.sh"

- name: Build system information
run: python3 .github/workflows/system-info.py

- name: Install Linux dependencies
run: |
.ci/install.sh
env:
GHA_PYTHON_VERSION: "3.x"

- name: Build
run: |
.ci/build.sh
- name: Docs
run: |
make doccheck
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

steps:
- name: "Check issues"
uses: actions/stale@v7
uses: actions/stale@v8
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
only-labels: "Awaiting OP Action"
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/test-cygwin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
name: Test Cygwin

on: [push, pull_request, workflow_dispatch]
on:
push:
paths-ignore:
- ".github/workflows/docs.yml"
- "docs/**"
pull_request:
paths-ignore:
- ".github/workflows/docs.yml"
- "docs/**"
workflow_dispatch:

permissions:
contents: read
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/test-docker.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
name: Test Docker

on: [push, pull_request, workflow_dispatch]
on:
push:
paths-ignore:
- ".github/workflows/docs.yml"
- "docs/**"
pull_request:
paths-ignore:
- ".github/workflows/docs.yml"
- "docs/**"
workflow_dispatch:

permissions:
contents: read
Expand All @@ -24,11 +33,11 @@ jobs:
# Then run the remainder
alpine,
amazon-2-amd64,
amazon-2023-amd64,
arch,
centos-7-amd64,
centos-stream-8-amd64,
centos-stream-9-amd64,
debian-10-buster-x86,
debian-11-bullseye-x86,
fedora-36-amd64,
fedora-37-amd64,
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/test-mingw.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
name: Test MinGW

on: [push, pull_request, workflow_dispatch]
on:
push:
paths-ignore:
- ".github/workflows/docs.yml"
- "docs/**"
pull_request:
paths-ignore:
- ".github/workflows/docs.yml"
- "docs/**"
workflow_dispatch:

permissions:
contents: read
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test-valgrind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,20 @@ name: Test Valgrind
on:
push:
paths:
- ".github/workflows/test-valgrind.yml"
- "**.c"
- "**.h"
pull_request:
paths:
- ".github/workflows/test-valgrind.yml"
- "**.c"
- "**.h"
workflow_dispatch:

permissions:
contents: read

concurrency:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

Expand Down
17 changes: 13 additions & 4 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
name: Test Windows

on: [push, pull_request, workflow_dispatch]
on:
push:
paths-ignore:
- ".github/workflows/docs.yml"
- "docs/**"
pull_request:
paths-ignore:
- ".github/workflows/docs.yml"
- "docs/**"
workflow_dispatch:

permissions:
contents: read
Expand Down Expand Up @@ -65,8 +74,8 @@ jobs:
7z x winbuild\depends\nasm-2.15.05-win64.zip "-o$env:RUNNER_WORKSPACE\"
echo "$env:RUNNER_WORKSPACE\nasm-2.15.05" >> $env:GITHUB_PATH
winbuild\depends\gs1000w32.exe /S
echo "C:\Program Files (x86)\gs\gs10.0.0\bin" >> $env:GITHUB_PATH
choco install ghostscript --version=10.0.0.20230317
echo "C:\Program Files\gs\gs10.00.0\bin" >> $env:GITHUB_PATH
# Install extra test images
xcopy /S /Y Tests\test-images\* Tests\images
Expand All @@ -88,7 +97,7 @@ jobs:
- name: Prepare build
if: steps.build-cache.outputs.cache-hit != 'true'
run: |
& python.exe winbuild\build_prepare.py -v --python=$env:pythonLocation --srcdir
& python.exe winbuild\build_prepare.py -v --python $env:pythonLocation
shell: pwsh

- name: Build dependencies / libjpeg-turbo
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
name: Test

on: [push, pull_request, workflow_dispatch]
on:
push:
paths-ignore:
- ".github/workflows/docs.yml"
- "docs/**"
pull_request:
paths-ignore:
- ".github/workflows/docs.yml"
- "docs/**"
workflow_dispatch:

permissions:
contents: read
Expand Down Expand Up @@ -96,11 +105,6 @@ jobs:
name: errors
path: Tests/errors

- name: Docs
if: startsWith(matrix.os, 'ubuntu') && matrix.python-version == 3.11
run: |
make doccheck
- name: After success
run: |
.ci/after_success.sh
Expand Down
48 changes: 48 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,54 @@ Changelog (Pillow)
9.5.0 (unreleased)
------------------

- Support custom comments and PLT markers when saving JPEG2000 images #6903
[joshware, radarhere, hugovk]

- Load before getting size in __array_interface__ #7034
[radarhere]

- Support creating BGR;15, BGR;16 and BGR;24 images, but drop support for BGR;32 #7010
[radarhere]

- Consider transparency when applying APNG blend mask #7018
[radarhere]

- Round duration when saving animated WebP images #6996
[radarhere]

- Added reading of JPEG2000 comments #6909
[radarhere]

- Decrement reference count #7003
[radarhere, nulano]

- Allow libtiff_support_custom_tags to be missing #7020
[radarhere]

- Improved I;16N support #6834
[radarhere]

- Added QOI reading #6852
[radarhere, hugovk]

- Added saving RGBA images as PDFs #6925
[radarhere]

- Do not raise an error if os.environ does not contain PATH #6935
[radarhere, hugovk]

- Close OleFileIO instance when closing or exiting FPX or MIC #7005
[radarhere]

- Added __int__ to IFDRational for Python >= 3.11 #6998
[radarhere]

- Added memoryview support to Dib.frombytes() #6988
[radarhere, nulano]

- Close file pointer copy in the libtiff encoder if still open #6986
[fcarron, radarhere]

- Raise an error if ImageDraw co-ordinates are incorrectly ordered #6978
[radarhere]

Expand Down
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,16 @@ coverage:
python3 -m coverage report

.PHONY: doc
doc:
.PHONY: html
doc html:
python3 -c "import PIL" > /dev/null 2>&1 || python3 -m pip install .
$(MAKE) -C docs html

.PHONY: htmlview
htmlview:
python3 -c "import PIL" > /dev/null 2>&1 || python3 -m pip install .
$(MAKE) -C docs htmlview

.PHONY: doccheck
doccheck:
$(MAKE) doc
Expand All @@ -38,7 +44,8 @@ help:
@echo " coverage run coverage test (in progress)"
@echo " doc make HTML docs"
@echo " docserve run an HTTP server on the docs directory"
@echo " html to make standalone HTML files"
@echo " html make HTML docs"
@echo " htmlview open the index page built by the html target in your browser"
@echo " inplace make inplace extension"
@echo " install make and install"
@echo " install-coverage make and install with C coverage"
Expand Down
4 changes: 2 additions & 2 deletions Tests/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

HAS_UPLOADER = False

if os.environ.get("SHOW_ERRORS", None):
if os.environ.get("SHOW_ERRORS"):
# local img.show for errors.
HAS_UPLOADER = True

Expand Down Expand Up @@ -271,7 +271,7 @@ def netpbm_available():

def magick_command():
if sys.platform == "win32":
magickhome = os.environ.get("MAGICK_HOME", "")
magickhome = os.environ.get("MAGICK_HOME")
if magickhome:
imagemagick = [os.path.join(magickhome, "convert.exe")]
graphicsmagick = [os.path.join(magickhome, "gm.exe"), "convert"]
Expand Down
Binary file added Tests/images/blend_transparency.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Tests/images/comment.jp2
Binary file not shown.
Binary file added Tests/images/hopper.qoi
Binary file not shown.
Binary file added Tests/images/pil123rgba.qoi
Binary file not shown.
21 changes: 11 additions & 10 deletions Tests/test_core_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,14 @@ def test_units(self):
Image._apply_env_variables({"PILLOW_BLOCK_SIZE": "2m"})
assert Image.core.get_block_size() == 2 * 1024 * 1024

def test_warnings(self):
pytest.warns(
UserWarning, Image._apply_env_variables, {"PILLOW_ALIGNMENT": "15"}
)
pytest.warns(
UserWarning, Image._apply_env_variables, {"PILLOW_BLOCK_SIZE": "1024"}
)
pytest.warns(
UserWarning, Image._apply_env_variables, {"PILLOW_BLOCKS_MAX": "wat"}
)
@pytest.mark.parametrize(
"var",
(
{"PILLOW_ALIGNMENT": "15"},
{"PILLOW_BLOCK_SIZE": "1024"},
{"PILLOW_BLOCKS_MAX": "wat"},
),
)
def test_warnings(self, var):
with pytest.warns(UserWarning):
Image._apply_env_variables(var)
Loading

0 comments on commit b8b153f

Please sign in to comment.