aws-solutions / serverless-image-handler

A solution to dynamically handle images on the fly, utilizing SharpJS
Apache License 2.0
1.33k stars 536 forks source link

Transformation of AVIF image not possible #582

Closed marco910 closed 3 hours ago

marco910 commented 19 hours ago

Describe the bug When trying to transform a AVIF image I get this error in the browser: {"message":"Internal error. Please contact the system administrator.","code":"InternalError","status":500} and this error in CloudWatch:

ERROR [Error: source: bad seek to 80560
heif: Invalid input: Unspecified: Bitstream not supported by this decoder (2.0)]

To Reproduce Upload a AVIF image to the S3 bucket and try to transform it using with/height properties and/or filters like to: https://xxx.cloudfront.net/125x125/filters:quality(80)/dev/avif-sample-image.avif

Expected behavior The transformed image is returned.

Please complete the following information about the solution:

simonkrol commented 16 hours ago

Hi @marco910, This may very well be expected. The prebuilt binaries for sharp only support AVIFs with a bit-depth of 8, so this likely isn't something we're going to be able to get working. I will however, include a task to update the documentation/returned error to make that more clear.

Thanks, Simon

marco910 commented 3 hours ago

Hi @simonkrol ,

Thanks for the explanation. When testing with an 8-bit AVIF, the transformation works fine.