Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Apr 20, 2024
1 parent 4b421a0 commit f521689
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 3 deletions.
73 changes: 72 additions & 1 deletion .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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""" `
Expand Down Expand Up @@ -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'
Expand All @@ -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
2 changes: 0 additions & 2 deletions winbuild/build/src/openjpeg-2.5.2/src/lib/openjp2/openjpeg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions winbuild/build/src/openjpeg-2.5.2/src/lib/openjp2/t2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit f521689

Please sign in to comment.