diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 96e4b1d5fd8..3c574668334 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -47,6 +47,12 @@ jobs: repository: python-pillow/pillow-depends path: winbuild\depends + - name: Checkout extra test images + uses: actions/checkout@v4 + with: + repository: python-pillow/test-images + path: Tests\test-images + # sets env: pythonLocation - name: Set up Python uses: actions/setup-python@v5 @@ -59,9 +65,29 @@ jobs: - name: Print build system information run: python3 .github/workflows/system-info.py + - name: Install Python dependencies + run: > + python3 -m pip install + coverage>=7.4.2 + defusedxml + olefile + pyroma + pytest + pytest-cov + pytest-timeout + - name: Install dependencies id: install run: | + choco install nasm --no-progress + echo "C:\Program Files\NASM" >> $env:GITHUB_PATH + + choco install ghostscript --version=10.3.0 --no-progress + echo "C:\Program Files\gs\gs10.00.0\bin" >> $env:GITHUB_PATH + + # Install extra test images + xcopy /S /Y Tests\test-images\* Tests\images + # make cache key depend on VS version & "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" ` | find """catalog_buildVersion""" ` @@ -90,9 +116,54 @@ jobs: if: steps.build-cache.outputs.cache-hit != 'true' run: "& winbuild\\build\\build_dep_zlib.cmd" + - name: Build dependencies / xz + if: steps.build-cache.outputs.cache-hit != 'true' + run: "& winbuild\\build\\build_dep_xz.cmd" + + - name: Build dependencies / WebP + if: steps.build-cache.outputs.cache-hit != 'true' + run: "& winbuild\\build\\build_dep_libwebp.cmd" + + - name: Build dependencies / LibTiff + if: steps.build-cache.outputs.cache-hit != 'true' + run: "& winbuild\\build\\build_dep_libtiff.cmd" + + # for FreeType CBDT/SBIX font support + - name: Build dependencies / libpng + if: steps.build-cache.outputs.cache-hit != 'true' + run: "& winbuild\\build\\build_dep_libpng.cmd" + + # for FreeType WOFF2 font support + - name: Build dependencies / brotli + if: steps.build-cache.outputs.cache-hit != 'true' + run: "& winbuild\\build\\build_dep_brotli.cmd" + + - name: Build dependencies / FreeType + if: steps.build-cache.outputs.cache-hit != 'true' + run: "& winbuild\\build\\build_dep_freetype.cmd" + + - name: Build dependencies / LCMS2 + if: steps.build-cache.outputs.cache-hit != 'true' + run: "& winbuild\\build\\build_dep_lcms2.cmd" + - name: Build dependencies / OpenJPEG run: "& winbuild\\build\\build_dep_openjpeg.cmd" + # GPL licensed + - name: Build dependencies / libimagequant + if: steps.build-cache.outputs.cache-hit != 'true' + run: "& winbuild\\build\\build_dep_libimagequant.cmd" + + # Raqm dependencies + - name: Build dependencies / HarfBuzz + if: steps.build-cache.outputs.cache-hit != 'true' + run: "& winbuild\\build\\build_dep_harfbuzz.cmd" + + # Raqm dependencies + - name: Build dependencies / FriBidi + if: steps.build-cache.outputs.cache-hit != 'true' + run: "& winbuild\\build\\build_dep_fribidi.cmd" + # trim ~150MB for each job - name: Optimize build cache if: steps.build-cache.outputs.cache-hit != 'true' @@ -109,5 +180,5 @@ jobs: - name: Test Pillow run: | path %GITHUB_WORKSPACE%\\winbuild\\build\\bin;%PATH% - python.exe -c "from PIL import Image;im = Image.open('image');im.load()" + python.exe -m pytest -vx -W always --cov PIL --cov Tests --cov-report term --cov-report xml Tests shell: cmd diff --git a/winbuild/build/src/openjpeg-2.5.2/src/lib/openjp2/openjpeg.c b/winbuild/build/src/openjpeg-2.5.2/src/lib/openjp2/openjpeg.c index 01cce1767f5..382d8f4f0f1 100644 --- a/winbuild/build/src/openjpeg-2.5.2/src/lib/openjp2/openjpeg.c +++ b/winbuild/build/src/openjpeg-2.5.2/src/lib/openjp2/openjpeg.c @@ -593,7 +593,6 @@ OPJ_BOOL OPJ_CALLCONV opj_decode_tile_data(opj_codec_t *p_codec, opj_stream_t *p_stream ) { - printf("torchwood\n"); if (p_codec && p_data && p_stream) { opj_codec_private_t * l_codec = (opj_codec_private_t *) p_codec; opj_stream_private_t * l_stream = (opj_stream_private_t *) p_stream; @@ -602,7 +601,6 @@ OPJ_BOOL OPJ_CALLCONV opj_decode_tile_data(opj_codec_t *p_codec, return OPJ_FALSE; } - printf("a\n"); return l_codec->m_codec_data.m_decompression.opj_decode_tile_data( l_codec->m_codec, p_tile_index, diff --git a/winbuild/build/src/openjpeg-2.5.2/src/lib/openjp2/t2.c b/winbuild/build/src/openjpeg-2.5.2/src/lib/openjp2/t2.c index 2c233f0fb66..b921626c6d9 100644 --- a/winbuild/build/src/openjpeg-2.5.2/src/lib/openjp2/t2.c +++ b/winbuild/build/src/openjpeg-2.5.2/src/lib/openjp2/t2.c @@ -1175,6 +1175,9 @@ static OPJ_BOOL opj_t2_read_packet_header(opj_t2_t* p_t2, } l_header_length = (OPJ_UINT32)(l_header_data - *l_header_data_start); + if (!l_header_length) { + return OPJ_FALSE; + } *l_modified_length_ptr -= l_header_length; *l_header_data_start += l_header_length;