Julián David
Julián David3mo ago

Are image transformations supported?

I don’t see anything related in the docs.
5 Replies
Convex Bot
Convex Bot3mo ago
Thanks for posting in <#1088161997662724167>. Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets. - Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.) - Use search.convex.dev to search Docs, Stack, and Discord all at once. - Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI. - Avoid tagging staff unless specifically instructed. Thank you!
lee
lee3mo ago
you can import an npm package into an action (you might need to put "use node" at the top) and use it to process the image.
lee
lee3mo ago
for example, this one looks popular: https://www.npmjs.com/package/sharp . i haven't used it myself, so be sure to let us know if you hit issues. in general convex functions can run arbitrary javascript and npm has a large assortment of packages you can use
npm
sharp
High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images. Latest version: 0.33.5, last published: a month ago. Start using sharp in your project by running npm i sharp. There are 4806 other projects in the npm registry using sharp.
Julián David
Julián DavidOP3mo ago
By offering an API that simplifies caching and CDN distribution, you could significantly enhance the current Storage service. This approach would provide a competitive edge similar to what users currently pay for in services like Cloudinary, Cloudflare Images, Supabase Storage, Imgix, Imagekit... Given that everything in Convex is designed with a great developer experience (DX) in mind, this would be a valuable addition.
jamwt
jamwt3mo ago
agreed! we have something underway. hoping to get an early version out soon