vercel / satori

Enlightened library to convert HTML and CSS to SVG
https://og-playground.vercel.app
Mozilla Public License 2.0
10.48k stars 229 forks source link

Support webp images #273

Open MillHaus33 opened 1 year ago

MillHaus33 commented 1 year ago

Feature Request

Allow webp images to be rendered

shuding commented 1 year ago

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.

styfle commented 1 year ago

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

Slashgear commented 6 months ago

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 ?

StephenTangCook commented 3 months ago

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