onflow / nft-catalog

https://www.flow-nft-catalog.com/
The Unlicense
36 stars 13 forks source link

Use IPFS gateway to load IPFS assets #86

Closed psiemens closed 1 year ago

psiemens commented 1 year ago

We noticed that IPFS images aren't displayed in the catalog web UI. Here's an example: https://nft-catalog.vercel.app/nfts/testnet/0xf1e7849ad48c52ca/athlete_studio_testnet/110265932

The image tag includes an ipfs:// URL (the result of calling ipfsFile.uri() in Cadence), but most browsers won't be able to resolve that.

<img src="ipfs://bafybeiefc2s5hkjfzbbwhehv2qe6cz3elik3plqv4g5kbdk6dqzv5lbfh4" width="50" height="50">

Instead, I'd recommend that the catalog use an IPFS gateway to convert the CID + path to an HTTP URL:

<img src="https://nftstorage.link/ipfs/bafybeiefc2s5hkjfzbbwhehv2qe6cz3elik3plqv4g5kbdk6dqzv5lbfh4" width="50" height="50">

Public IPFS gateways: https://ipfs.github.io/public-gateway-checker/