Skip to content

Fix Imagequant linkage on Windows - #10050

Closed
akx wants to merge 1 commit into
python-pillow:mainfrom
akx:win-imagequant
Closed

akx wants to merge 1 commit into
python-pillow:mainfrom
akx:win-imagequant

Conversation

@akx

@akx akx commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

imagequant isn't linked into official Windows wheels because it's GPL, but it also wasn't being correctly found or linked for Windows tests. IOW, tests spent time building it, only to not use it.

This also notes Rust is required to build it.

CI on main:

D:\a\Pillow\Pillow>python.exe -bb -m pytest -vv -x -W always --numprocesses=logical --dist=worksteal --cov PIL --cov Tests --cov-report term --cov-report xml Tests 
[...]
*** RAQM (Bidirectional Text) support not installed
*** LIBIMAGEQUANT (Quantization method) support not installed
*** XCB (X protocol) support not installed
--------------------------------------------------------------------

CI on this branch:

D:\a\Pillow\Pillow>python.exe -bb -m pytest -vv -x -W always --numprocesses=logical --dist=worksteal --cov PIL --cov Tests --cov-report term --cov-report xml Tests 
[...]
*** RAQM (Bidirectional Text) support not installed
--- LIBIMAGEQUANT (Quantization method) support ok, loaded 4.2.2
*** XCB (X protocol) support not installed
--------------------------------------------------------------------

@radarhere

Copy link
Copy Markdown
Member

Our 32-bit Windows job is failing - https://github.com/python-pillow/Pillow/actions/runs/36002233957/job/107927620503?pr=10050#step:28:646

QuantPngQuant.obj : error LNK2001: unresolved external symbol _liq_image_destroy
QuantPngQuant.obj : error LNK2001: unresolved external symbol _liq_set_output_gamma
QuantPngQuant.obj : error LNK2001: unresolved external symbol _liq_write_remapped_image_rows
QuantPngQuant.obj : error LNK2001: unresolved external symbol _liq_version
QuantPngQuant.obj : error LNK2001: unresolved external symbol _liq_result_destroy
QuantPngQuant.obj : error LNK2001: unresolved external symbol _liq_image_create_rgba
QuantPngQuant.obj : error LNK2001: unresolved external symbol _liq_quantize_image
QuantPngQuant.obj : error LNK2001: unresolved external symbol _liq_attr_destroy
QuantPngQuant.obj : error LNK2001: unresolved external symbol _liq_attr_create
QuantPngQuant.obj : error LNK2001: unresolved external symbol _liq_set_max_colors
QuantPngQuant.obj : error LNK2001: unresolved external symbol _liq_get_palette
QuantPngQuant.obj : error LNK2001: unresolved external symbol _liq_set_dithering_level

@akx

akx commented Sep 25, 2026

Copy link
Copy Markdown
Contributor Author

@radarhere Right... cargo builds for the host architecture (and the GHA runners are AMD64) by default. I actually have a pull request that may fix that (since I had to build Pillow for Python AMD64 on an Windows ARM64)...

@radarhere

Copy link
Copy Markdown
Member

#10052 has replaced this.

@radarhere radarhere closed this Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants