Ability to scale images server side

For our project we need to be able to save a lower res version of an image, for example:

  1. 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

  2. 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 :slight_smile:

Decided for now to do it client side in the CMS. Make a button to generate thumbnails from all NFTs in the db and upload them to Moralis storage and append the url to the NFTOwners object.
Using Cloudinary REST API to upload files requires sha256 or sha1 to work in Moralis cloud functions (to generate a signature).