satori icon indicating copy to clipboard operation
satori copied to clipboard

Support webp images

Open MillHaus33 opened this issue 2 years ago • 4 comments

Feature Request

Allow webp images to be rendered

MillHaus33 avatar Oct 29 '22 06:10 MillHaus33

It’s very likely that we will not implement this feature. For static images, you can convert its type manually; for images from a CDN (e.g. Cloudinary or Unsplash), usually you can specify the format via a parameter.

shuding avatar Oct 30 '22 18:10 shuding

You can also use Next.js Image Optimization. Something like:

https://example.com/_next/image?url=%2Fapi%2Fog&w=1920&q=75

Update: you can use import { getImageProps } from 'next/image' to generate this string

styfle avatar Oct 30 '22 19:10 styfle

Hi ! @shuding

I took time during week to try to handle webp image format in satori directly. Probably faced the issue you faced with the file format decoding.

I figured out the only this that I needed to decode was the image width and height. Am I wrong ? Could we get it from the EXIF metadatas ?

Slashgear avatar Jan 03 '24 19:01 Slashgear

This limitation should at least be doc'd. Is there a list of supported image types somewhere?

StephenTangCook avatar Mar 28 '24 19:03 StephenTangCook