Closed cristovaoth closed 2 years ago
just tested, generated images look great. I'll create a vercel deployment to test how long an actual serverless function takes to run this.
I called it /api/thumbnail but this is not yet a thumbnailing service. Alternative name?
/api/download
makes sense to me
loading indicator?
I'll add something for this
How advanced should the input validations be?
i'm down with what feels right to you, seems like the worst that could happen is a broken image
Should the service render minted NFTs? I.e., provide only tokenId, query onchain data, render, take pic
yes it should, as people will want to download images of the nft with the minted name and added effects. we could also use the opensea api for this.
Should we spin a similar service that creates real thumbnails for a list views? Would require a cache, thus making the service non stateless
Opensea uses a cache with their api, we could use theirs if we think it's necessary, but pulling directly from the contract for now makes sense to me.
This looks good. 👌
Should the service render minted NFTs? I.e., provide only tokenId, query onchain data, render, take pic
This should actually be the primary use case, no? People need to download a JPEG if they wanna use their wand as a PFP (since most sites don't support SVG PFPs).
I would even question whether we really should allow downloading JPEGs of unminted wands. After all we don't wanna promote people using wand images as PFPs that don't exist as NFTs.
Should we spin a similar service that creates real thumbnails for a list views? Would require a cache, thus making the service non stateless
We could look into caching/thumbnailing the JPEG renders later potentially. Cloudflare offers some nice services for that kind of stuff.
I would even question whether we really should allow downloading JPEGs of unminted wands. After all we don't wanna promote people using wand images as PFPs that don't exist as NFTs.
since people can easily screencap any wands they are making anyway, I'm ok with having this ability for unminted wands. More wand imagery out in the wild is good imo, helps spread zodiac ~vibes~
superseded by #87
First try for JPEG generation. It's a serverless lamba, where we spin up a headless chrome.
@samepant you can play with the resolutions, for the full download, 2000x3000 is much slower than 1000x1500
Open questions: