For our project we need to be able to save a lower res version of an image, for example:
automatically scale big image down to optimize them for web use, like banners and other info pages that can be managed through the backend of the platform by content managers
automatically scale NFT images to use as SEO/sharing image meta, including converting animated gifs
For 1 I currently do it client side before upload, not problem.
But for 2 I would prefer to do it in a beforeSave could function when minting the NFT. This way the SEO thumbnail would become an extra field in NFTOwners.
As I can’t include any libs in cloud functions, like
sharp for node.js, I’m currently integrating with Cloudinary, but not my preferred choice. I can use their api to generate a thumbnail from the NFT image and save the url in the Moralis db.
Any ideas on this subject? For us SEO is important, as we’re trying to build a mainstream product that can be indexed by search engines like ‘normal’ web shops.
On your side, you could also consider a proxy running that can convert requested images on the fly, of course with paid credits. I understand this is far beyond what your focusing on now, but thought I’d throw it in the bucket.
Actually, you could just allow the cloudinary node SDK in cloud functions