Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AVIF (Limited?) Support Question #206

Closed
majora2007 opened this issue May 11, 2023 · 2 comments
Closed

AVIF (Limited?) Support Question #206

majora2007 opened this issue May 11, 2023 · 2 comments
Labels
question Further information is requested

Comments

@majora2007
Copy link

majora2007 commented May 11, 2023

I'm trying to load an AVIF file and save as PNG, like I do with many of the other formats, but I get:

NetVips.VipsException: unable to call VipsForeignSaveSpngFile
source_custom: bad seek to 83048
heif: Invalid input: Unspecified: Bitstream not supported by this decoder (2.0)

when using it on https://raw.githubusercontent.com/link-u/avif-sample-images/master/fox.profile0.10bpc.yuv420.avif

NetVips code:

 using var thumbnail = Image.ThumbnailBuffer(Convert.FromBase64String(encodedImage), thumbnailWidth);
fileName += (saveAsWebP ? ".webp" : ".png");
thumbnail.WriteToFile(_directoryService.FileSystem.Path.Join(_directoryService.CoverImageDirectory, fileName));

My knowledge of AVIF is pretty low, but is this something that is planned to be enhanced in the future (by libvips) or should I just hold off on AVIF support? It seems like 10bit images are the key which don't have support?

I wanted to validate against these free images to understand NetVips support for the format, given Firefox has just released with full support.

https://github.com/link-u/avif-sample-images/blob/master/fox.profile0.10bpc.yuv420.avif

@kleisauke kleisauke added the question Further information is requested label May 12, 2023
@kleisauke
Copy link
Owner

This AVIF image is 10-bit, which is unsupported by the pre-built libvips binaries provided by NetVips.

$ heif-info -d fox.profile0.10bpc.yuv420.avif | grep bit
| | | bits_per_channel: 10,10,10
| | | high_bitdepth: 1
| | | twelve_bit: 0

See the CHANGELOG.native.md for 8.10.6.

Please subscribe to lovell/sharp-libvips#97 for updates about a possible switch to smaller/faster alternatives for AVIF that might allow reading higher bit depth images again.

@majora2007
Copy link
Author

Thanks kleisauke, will do. I figured it might be the 10bits, but wasn't sure if libvips had plans around support it further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants