ElkArte Community

Extending Elk => Addons => Topic started by: tino on March 17, 2018, 11:52:15 am

Title: [ADDON] External Image Proxy for http images
Post by: tino on March 17, 2018, 11:52:15 am
Hi All,

Similar to the image proxy enchancement by spuds, this uses an external image proxy service rather than your local server.

http://addons.elkarte.net/enhancement/ExtImageProxy.html

I've tested it under every condition I can think off. It doesn't work the same way as spuds image proxy addon as it parses the whole page and then adds the links rather than doing it as you import the data.

I've not noticed any issues with doing it this way, but please let me know if you do have issues.

Thanks

tino
Title: Re: [ADDON] External Image Proxy for http images
Post by: Frenzie on March 17, 2018, 01:40:38 pm
Did you notice my post about the ImageProxy extension I wrote for FreshRSS by any chance? :)

https://github.com/FreshRSS/Extensions/blob/4a2c6387b9c9a447c44715f9a29d47b654c1abbe/xExtension-ImageProxy/extension.php

It's based on the same idea (and the same default proxy).

Feel free to copy parts from my README if you find them applicable: https://github.com/FreshRSS/Extensions/blob/4a2c6387b9c9a447c44715f9a29d47b654c1abbe/xExtension-ImageProxy/README.md

I'd also suggest adding an admin setting to change the proxy. ;)
Title: Re: [ADDON] External Image Proxy for http images
Post by: tino on March 17, 2018, 02:04:31 pm
I hadn't actually.  It came from this issue over at SMF. https://www.simplemachines.org/community/index.php?topic=559023.20

I had already written the parsing code for TinyPortal and the integration of the SMF image proxy, switching it to use an external image proxy was a easy next step.

I meant to add a README, haven't got round to it yet.

I was going to add the option to use camo or weserv. I don't know of any other external services other than aws or similar.

Any further development will really depend upon it's popularity. It suits the purpose I needed, and I thought I would share it to others. I do appreciate your feedback.
Title: Re: [ADDON] External Image Proxy for http images
Post by: Frenzie on March 17, 2018, 05:42:06 pm
Should you be interested, I'm referring to this post: https://www.elkarte.net/community/index.php?topic=3432.msg30448#msg30448

QuoteI was going to add the option to use camo or weserv. I don't know of any other external services other than aws or similar.
Note in particular the "proxy settings" part of my README. ;)
Title: Re: [ADDON] External Image Proxy for http images
Post by: tino on March 18, 2018, 05:04:24 am
It was more that each one has it’s own way of passing the url to fetch.

The current one removes the http, camo likes the https and also adds the key/hash.

Adding any proxy would require some custom code to enable that and allow you to choose the configuration.

If someone requests the addition of another proxy variant then I’m more than happy to add it. I think that’s the best way to expand this modification if it’s required.

I’ve taken some bits of your README thanks.
Title: Re: [ADDON] External Image Proxy for http images
Post by: Frenzie on March 18, 2018, 09:25:49 am
Regardless of other methods that may or may not be compatible, my point here is that just like camo you can set up your own "weserv" proxy wherever you want in seconds: https://github.com/andrieslouw/imagesweserv/blob/3.x/DOCKER.md

(Not that altering the URL in the file itself is a big chore, but it's nice polish to have. ;))
Title: Re: [ADDON] External Image Proxy for http images
Post by: tino on April 14, 2018, 01:00:26 pm
Quote from: Frenzie – Regardless of other methods that may or may not be compatible, my point here is that just like camo you can set up your own "weserv" proxy wherever you want in seconds: https://github.com/andrieslouw/imagesweserv/blob/3.x/DOCKER.md

(Not that altering the URL in the file itself is a big chore, but it's nice polish to have. ;))

I added the option to use camo, nginx or your own weserv proxy url.

Can download it here; https://github.com/tinoest/ElkExtImageProxy/archive/ElkExtImageProxy-V1.1.0.tar.gz

I think that covers most options?
Title: Re: [ADDON] External Image Proxy for http images
Post by: radu81 on April 20, 2018, 04:13:48 am
I am getting a lot of errors using php 7.2 and this addon
https://screenshots.firefox.com/t4gNGOjxyc2JQUT7/www.skodaclub.it
Title: Re: [ADDON] External Image Proxy for http images
Post by: tino on April 20, 2018, 01:10:30 pm
I think removing the & before the variable will solve this issue.

Can you try this version? You have to enable it in the settings, and choose the proxy, leave the other two files blank if you want to use the same as the orginal mod.

https://github.com/tinoest/ElkExtImageProxy/archive/master.zip