-
-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix image hosting. #29
Comments
I'd recommend having a SaveBlueprint.js saga that handles the adding and updating of blueprints. All of the write code for the images would be self-contained in this one file, making changes easier in the future. Then, in the EditBlueprint and Create components you could just call I only mention because I notice that the add and edit code has been implemented separately in different component, making fixes slower. I'd give it a go myself but am not comfortable with firebase, nor am I familiar with Google Storage. I'd also recommend having an <BlueprintImage / > component that accepts a |
You can use Google Cloud Storage and Google App Engine to store your images and use their free resizing magic URLs to reduce bandwidth costs |
@asasine That's a good idea, because the images are already in GCS |
I thought i should post this somewhere but in despiration for blueprints i knocked this dirty tampermonkey userscript together that unblocks any imgur images on factorio blueprints. |
I'd like to add that there's many browsers that already have similar functionality built in. I never even noticed the images not working, since I'm using brave browser. |
how to fix photo problem. как исправить проблему с фото |
S3 + Cloudflare on a static content domain. Maximize cache options (Cache-Control: public, max-age=86400). S3 has no competitors from egress data cost ($0.0007 per GB, $0.0004 per 1,000 requests). Cloudflare has an exceptional CDN. Yeh, cloudfront, cloudinary, etc are free for the first x usage, but after that their costs increase rapidly. AWS does provide some free stuff for the first 12 months of your account. |
tampermonkey script works but needs the |
May I ask, what is current total size of images? |
they do not have there is just a file crossed. 01.07.2019, 02:18, "Dmitry Murzin" <[email protected]>:May I ask, what is current total size of images?
—You are receiving this because you commented.Reply to this email directly, view it on GitHub, or mute the thread.
|
Thanks05.07.2019, 07:03, "Grzegorz Krzemiński" <[email protected]>:Why dont you just change img to iframe ? Just for now.
—You are receiving this because you commented.Reply to this email directly, view it on GitHub, or mute the thread.
|
@FactorioBlueprints if you are ok with this solution I can make a PR |
wouldn't setting |
don’t know if that would work or not but worth investigating. |
Imgur is not a free CDN, working around the block is not a solution to the problem. The fix to this is to replace the Imgur hosting code with logic that uploads to an S3 bucket or similar and to set up a CDN to cache those images, which costs money but not much. A quick search for |
8.5 GB @dima74 |
@pavlukivan I've done that now. Force refresh and take a look. It's not working for me but maybe I messed something up. |
@vcarl I'm working on the rest rewrite on the master branch and temporarily deleted all write functionality. The code to upload to both google and imgur lives in the Create component on the stable branch. |
Since the game is sprite
|
console: |
Hm, doesn't work here either. Maybe using the http header instead would work? https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy |
Hotlinking to imgur images works on their http addresses. I have no idea if they prefer you to use the https endpoints, but here is proof that it works on http. Open a page on Factorio Prints and run this in Chrome's console: edit: ok I guess Mixed Content errors is probably the reason for this. The above was a good quick hack for me when I just wanted to see the images. Hopefully a better permanent solution can be found soon :) |
@FactorioBlueprints So, it seems like you need to green light an approach here. I can work decoupling everything from imgur and pushing assets to Cloudinary as well as writing a conversion script that bulk-processes the images, however there will be cost associated with the service provider that you'd need to accept. If you pick a desired approach, I think that can help move this along. |
I just tried changing the links from https to http, not sure if it would really work. After a force-refresh, it does appear to work. This is a decent workaround for now and I'm glad it's live. Still imgur could ban my whole account or take down these images without warning at any point. I'd like to move to cloudinary still. Maybe it's not as much of a rush though. |
Images are primarily in Imgur, and it seems that factorioprints.com got banned by Imgur.
Backup images are in Google Cloud Storage in gs://facorio-blueprints.appspot.com.
Likely next steps:
The text was updated successfully, but these errors were encountered: