Im using a free sub domain from infinityfree and one of the limitations of that is the daily hit rate (can’t exceed 50,000)
Because of this I’m unable to upload images (there’s around 1000 small files) of pokemon sprites as that massively contributes to the daily hit rate.
So I’m trying a workaround which is to upload the files onto google drive and read the files from there via it’s individual file url.
From looking at the console it appears it’s reading the g-drive file correctly but the image still isn’t loading. The folder in which the file is located is set to “anyone with the link can view” so there shouldn’t be accessing issues here
Google Drive, as far as I know, doesn’t support direct file embeds, and probably have hotlink protection. You must use services that allow embeding directly.
I think that our hosting have CORS policies that block other sites from embeding your content, but it shouldn’t affect you from embeding files from other sites if they have correct CORS policies set.
Google is blocked in my country so unfortunately I cannot test the Google side — tests here showed no errors embeding other sites’ files.
The imgur file was solely to test if using the embed imgur link worked and it did. I only tested just with bulbasaur but because the other pokemon was still mapped to the google drive file ids, that’s why the number of requests occurred
All I want to achieve is show the sprite of each pokemon. Each pokemon has an internal id of 001 for bulbasaur and 002 for ivysaur etc etc.
I’m unable to upload images directly to the site without maxing out the daily limit rate (there’s over 1000 sprites).
As a workaround, I’m doing a mapping mechanism where I upload the sprite (that is named 001.png etc) to google drive and map that with the pokemon id of 001.
Google drive doesn’t explicitly show the filename in the url, it’s a file id value instead. So that’s why I’m mapping the pokemon id to the file id.
I just don’t know why the image doesn’t render despite me successfully achieving the above and the console confirming that it’s displ\ying the correct url.
Atm I’m trying to use Imgur’s API to bulk upload onto imgur and then map to a json file. But that’s proving really difficult
You probably have a lot of images in your browser cache, so you don’t see the actual number of REQs
Basically your website overwhelms imgur server with a flood of traffic (DOS) and the server defends itself and refuses to serve as soon as the number of requests exceeds a certain number
it would be ideal if you put all the Pokemon images in one image (image sprites)
so then you would only have one request instead of a thousand
but I assume that then it also requires JS modification and mapping of each image coordinate where which image is positioned in that one image (file) and connect it all.
This was my ideal route, but I found it difficult to map the pokemon id to specific coordinates. in the sprite sheet. Which is more of a knowledge gap than anything.
Internally, each pokemon has an id of 001, 002 and so forth. Each sprite is named 001.png so the id and sprite name matches like for like.
I’m not sure to get that filename metadata from the sprite sheet.