Omar
Omar•2w ago

Anyone know a good npm library for

Anyone know a good npm library for cropping images in Convex action functions? keep running into errors with the usual suspects (sharp lib)
4 Replies
erquhart
erquhart•2w ago
This exists, I know nothing about it but the docs look nice: https://jimp-dev.github.io/jimp/. Unless you're actually letting users crop images in-app, I'd also consider using something like Cloudflare's image cdn to serve the sizes you want. Curious what you're running into with sharp though, especially in node env.
Jimp
Jimp
JavaScript Image Manipulation Program
Omar
OmarOP•2w ago
I'm going to give that a try, thank you. This is for a back office function not end user initiated croppings in app. Error log: https://pastebin.com/v5JB5QCk Maybe I missed something with the platform: 'node' call out
Pastebin
⠋ Preparing Convex functions...✘ [ERROR] Could not resolve "node:ut...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
erquhart
erquhart•2w ago
Recent tip from Nicolas, mark sharp as an external package: https://discord.com/channels/1019350475847499849/1019350478817079338/1347637114195415130
Omar
OmarOP•2w ago
Thank you, everything working now with sharp, thanks!! 😄

Did you find this page helpful?