Generate thumnails automatically in static website
Unanswered
Chilean jack mackerel posted this in #help-forum
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 mackerel 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?
New Zealand
do you mean open graph images? if so vercel has a built in package for it:
https://vercel.com/docs/functions/og-image-generation
https://vercel.com/docs/functions/og-image-generation
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 servedChilean jack mackerelOP
Ok, just discovered https://github.com/vercel/next.js/discussions/19065. Goodbye next.js!