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

Are there any plans to support the heic extension? #575

Open Na-hyunwoo opened 2 months ago

Na-hyunwoo commented 2 months ago

Is your feature request related to a problem? Please describe. If you try to import an image with the following heic extension from the S3 bucket using SIH, a 500 error occurs. heic image link: https://img.tumblbug.com/eyJidWNrZXQiOiJ0dW1ibGJ1Zy1kZXZlbG9wbWVudCIsImtleSI6InJldmlldy80MmIwNGEzZi02NTBmLTRhNTktYjRiMC0yYTg4NGI4MTRmMDMuaGVpYyIsImVkaXRzIjp7InJlc2l6ZSI6eyJ3aWR0aCI6MTI0MCwid2l0aG91dEVubGFyZ2VtZW50Ijp0cnVlfX19

{
  "status": 500,
  "code": "RequestTypeError",
  "message": "The file does not have an extension and the file type could not be inferred. Please ensure that your original image is of a supported file type (jpg/jpeg, png, tiff, webp, gif, avif). Inferring the image type from hex headers is not available for SVG images. Refer to the documentation for additional guidance on forming image requests."
}

The extensions currently supported by SIH appear to be png, webp, tiff, gif, jpeg, and avif, but the extension for photos taken with an iPhone is heic.

Considering the iPhone, which accounts for a large portion of mobile phones worldwide, I think it is a huge disadvantage that SIH does not support the heic extension.

I know that the heic extension has been discussed for a long time, and I wonder if you guys have the will to solve this problem. If you don't have the will to solve it quickly, can you tell me about another alternative?

Describe the feature you'd like I hope you were able to successfully import the heic extension image using SIH.

Additional context I am the most active user of SIH at my company, so I am very interested in your service. So I am also curious about why the heic extension is not supported. And this error is occurring in a method called inferImageType. Could you please explain whether this is simply a problem caused by not being able to infer the type, or if there is a further problem?

simonkrol commented 2 months ago

Hi @Na-hyunwoo,

While Sharp "supports" heic, due to the patent-encumbered nature of the format, it isn't supported out of the box and would require additional customization of our Sharp installation to make work. For this reason, we don't currently have plans to implement it, though that could change in the future. I'll add a task internally to evaluate the difficulty in adding support.

Thanks, Simon

Na-hyunwoo commented 1 month ago

Hi @simonkrol,

Thank you for your reply.

Does the fact that the format is patented mean that it will be difficult for me to customize and use the solution?

If I can customize the solution and use it, can you tell me in detail what process I need to go through?

Since I do not have much knowledge about image processing and am just learning, I think the more detailed the explanation, the better.

Thank you 🙏