Jako / ImagePlus

Advanced Image Custom TV in MODX Revolution
https://jako.github.io/ImagePlus/
GNU General Public License v2.0
29 stars 20 forks source link

AWS Sources #119

Open matdave opened 11 months ago

matdave commented 11 months ago

I've added a trim statement to the URL to help with external image sources. These return with the base URL prepended when grabbed from the media browser.

Jako commented 11 months ago

Thank you! Since I can't test this here, I'll have to rely on your suggestion. Does this touch any other media source types?

Jako commented 7 months ago

I don't think that the regex is right in your patch. It trims multiple baseUrls on the left from the src. This is maybe right, if the baseUrl value of the mediasource contains only a slash, but not if it contains i.e. slashes and a cultureKey.

Can you give an example for the input and the result? Is it ok to trim only a single value?

matdave commented 7 months ago

It may be wrong. It's just what I threw on a site to make it work :rofl:. Example on the site was the src returns https://s3.site.com/path/to/image.jpg. and it was outputting https://s3.site.com/https://s3.site.com/path/to/image.jpg with ImagePlus

matdave commented 7 months ago

I had a similar issue on the new BannerX fork, and solved it on the PHP side here:

3.x https://github.com/matdave/BannerRevised/blob/c8ff8dd032d69ffd478990b5b07fd10b676236fd/core/components/bannerrevised/src/Model/Ad.php#L28 2.x https://github.com/matdave/BannerRevised/blob/c8ff8dd032d69ffd478990b5b07fd10b676236fd/core/components/bannerrevised/model/bannerrevised/brevad.class.php#L5