aryehraber / statamic-responsive-img

Statamic v2 Addon that automatically handles responsive images using srcset.
MIT License
12 stars 1 forks source link

Doesn't seem to work with S3-based assets #18

Open jeffmckeand opened 5 years ago

jeffmckeand commented 5 years ago

I have a site configured to use an S3 bucket to manage assets. Serving cached images directly works just fine with a standard glide tag, but for some reason, the responsive_img tag doesn't generate anything. No markup whatsoever. Is this a known issue with S3-based assets?

aryehraber commented 5 years ago

This Addon was never tested with a S3 setup so it could very well not work. Most likely won't be able to look into this, but happy to merge a PR if you are able to fix the issue.

jeffmckeand commented 5 years ago

That's unfortunate. I don't have the knowledge or expertise to dig in to this, but could definitely use the functionality. I'll dig around a bit.

jeffmckeand commented 5 years ago

FYI, switching to the {{ responsive_img image={{ variable }}" }} syntax does throw an error:

Method Illuminate\View\View::__toString() must not throw an exception, caught ErrorException: file_get_contents(/Users/username/Sites/sitename/public/https://site.test/img/containers/s3/images/image.png/45438d2c65a76b22953903f5babf10e2.jpg): failed to open stream: No such file or directory (View: /Users/username/Sites/sitename/site/addons/ResponsiveImg/resources/views/img.blade.php)

Looks like the domain name is being unnecessarily tossed into the path.