aws-samples / image-optimization

Simple, performant and cost efficient solution for optimizing images using Amazon CloudFront, Amazon S3 and AWS Lambda
MIT No Attribution
172 stars 106 forks source link

Getting error in formating heic or heif images. #15

Open Ajay-Bacancy opened 9 months ago

Ajay-Bacancy commented 9 months ago

This is the x-amz-cf-id header value TLjyVUbQnJInz6NVG_u53VFWVxSEMacbZOrC8xJvOJyFA5RYwarEeg== I'm not able to format heic file from the bucket it giving me this error error transforming image. original file link is https://fanbasis.s3.us-west-2.amazonaws.com/production/uploads/ljHFdSjOoA80ef54c8c370dcff4e26901ae6302e07.heic

Also If I'm trying to access video file without any tranformatio it give me internal server error.

bensquire commented 9 months ago

It doesn't look like Sharp (the image library used) supports that format?

https://github.com/lovell/sharp/issues/1105

achrafsouk commented 8 months ago

This is possible actually, but as mentioned in https://github.com/lovell/sharp/issues/1105, it requires a custom, globally-installed libvips that has itself been compiled with support for libheif. While we do not do it today in this code base, you shoud be able to. I've also seen Lambda Layers that facilitates this task. If we see +1 on this issue, we will consider updating the code to support it.