Next.js Discord

Discord Forum

Generate thumnails automatically in static website

Unanswered
Chilean jack mackerel posted this in #help-forum
Open in Discord
Chilean jack mackerelOP
I'm considering using next.js for a static website, but I'd like to be sure that it is possible to automatically generate thumnails of images (for instance in the context of a gallery)… but I can't find much information on this. Is it possible?

7 Replies

Chilean jack mackerelOP
I'm not sure to see how this relates: open graph seems to be about metadata right? What I want is basically a script to automatically scale down images to create a thumbnail to save bandwith, without having to do it all myself.
New Zealand
yeah you could use next js image tag and specify with width and height properties in it. next js will automatically optimize the images for you. make sure to have sharp package installed and host it on vercel.
Chilean jack mackerelOP
I'll check this… but I want a static website at the end, is it also supposed to work?
Chilean jack mackerelOP
I just tried… and no, it adds a link like /_next/…?img=…,size=… but without surprise the link is broken since it is statistically served
Chilean jack mackerelOP
Ok, just discovered https://github.com/vercel/next.js/discussions/19065. Goodbye next.js!