fdintino / pillow-avif-plugin

A pillow plugin that adds avif support via libavif
BSD 2-Clause "Simplified" License
90 stars 13 forks source link

Build musllinux wheels for alpine users #2

Closed ContinentalGuy closed 2 years ago

ContinentalGuy commented 3 years ago

Hi, @fdintino !

I ran into an error while trying to save image.

  File "/app/source/application/utils/resize.py", line 52, in save_image_to_buffer
    image.save(result, format=out_type, **save_kwargs)
  File "/usr/local/lib/python3.7/site-packages/PIL/Image.py", line 2102, in save
    save_handler(self, fp, filename)
  File "/usr/local/lib/python3.7/site-packages/pillow_avif/AvifImagePlugin.py", line 199, in _save
    is_single_frame,
RuntimeError: Failed to encode image: No codec available

Could you please help me to understand what package did i forget to install.

ContinentalGuy commented 3 years ago
$ /app/source # apk list -I | grep avif
.pillow-deps-avif-20210520.085254 noarch {.pillow-deps-avif} () [installed]
libavif-dev-0.9.0-r0 x86_64 {libavif} (BSD-2-Clause) [installed]
libavif-apps-0.9.0-r0 x86_64 {libavif} (BSD-2-Clause) [installed]
libavif-0.9.0-r0 x86_64 {libavif} (BSD-2-Clause) [installed]
$ /app/source # apk list -I | grep aom
aom-libs-1.0.0-r3 x86_64 {aom} (custom) [installed]
aom-1.0.0-r3 x86_64 {aom} (custom) [installed]
fdintino commented 3 years ago

What output do you get when you run the command avifenc -V?

ContinentalGuy commented 3 years ago
$ /app # avifenc -V
/bin/sh: avifenc: not found

🙂

ContinentalGuy commented 3 years ago

By the way, my microservice is running on alpine. I believe it is crucial for the issue, as when I moved the microservice to ubuntu, no "codec errors" appeared and everything went fine.

ContinentalGuy commented 3 years ago

Cannot find it in alpine packages.

fdintino commented 2 years ago

It looks as though I'll probably need to build musllinux wheels. And to do that I may need to switch to cibuildwheel, which has musl support in its latest alpha release. I might keep the multibuild infrastructure in place (since it's the basis for some of my PRs to merge this into Pillow) even if I add cibuildwheel for alpine-compatible wheels.