remicollet / remirepo

Issue tracker for
https://rpms.remirepo.net/
278 stars 53 forks source link

vips unable to generate heif image #248

Closed devhaozi closed 10 months ago

devhaozi commented 10 months ago

I install vips and vips-heif and vips-tools packages on AlmaLinux 9.3, and I try to use vips copy 1.png 1.heif to convert a png image to heif, it return error heifsave: Unsupported compression.

image

I've also tried other encodings such as avif jxl and they all work fine.

devhaozi commented 10 months ago

https://github.com/libvips/libvips/discussions/3173 may help.

remicollet commented 10 months ago

I was able to reproduce on EL-9 with libheif 1.16.1, but only once... so Heisenbug

libheif seems OK

$ heif-enc 1.png
$ file 1.heic
1.heic: ISO Media, HEIF Image HEVC Main or Main Still Picture Profile

$ heif-convert 1.heic  1.png
File contains 1 image
Written to 1.png
$ file 1.png
1.png: PNG image data, 420 x 460, 8-bit/color RGBA, non-interlaced

vips seems also OK

$ vips copy 1.png 1.heic
$ file 1.png 1.heic
1.png:  PNG image data, 420 x 460, 8-bit/color RGBA, non-interlaced
1.heic: ISO Media, HEIF Image HEVC Main or Main Still Picture Profile

$ vips copy 1.heic x.png
$ file 1.heic x.png
1.heic: ISO Media, HEIF Image HEVC Main or Main Still Picture Profile
x.png:  PNG image data, 420 x 460, 8-bit/color RGBA, non-interlaced
remicollet commented 10 months ago

Ok, found:

# vips copy 1.png 1.heic
heifsave: Unsupported compression

# heif-enc --list-encoders
HEIC encoders:
AVIF encoders:
- aom = AOMedia Project AV1 Encoder v3.7.1 [default]

# dnf install libheif-freeworld
...

# heif-enc --list-encoders
HEIC encoders:
- x265 = x265 HEVC encoder (3.5+1-f0c1022b6) [default]
AVIF encoders:
- aom = AOMedia Project AV1 Encoder v3.7.1 [default]

# vips copy 1.png 1.heic
# file 1.heic
1.heic: ISO Media, HEIF Image HEVC Main or Main Still Picture Profile

This mean additional codecs (not suitable for EPEL) are available in RPMfusion

remicollet commented 10 months ago

For next vips build, I will add a weak dependency on the libheif-freeworld, but this will only work if RPMFusion is enabled.

devhaozi commented 10 months ago

For next vips build, I will add a weak dependency on the libheif-freeworld, but this will only work if RPMFusion is enabled.

After enable RPMfusion and install libheif-freeworld, it works well. Thank you.