1

I've just set up an S3 bucket and have a transform in my template. Should these transformed images be saved on S3? It doesn't look like they are, however my template is pulling out an S3 URL:

<img src="{{ asset.getUrl(resize) }}" width="{{ asset.getWidth(resize) }}" height="{{ asset.getHeight(resize) }}" alt="A photograph of {{ entry.title }}" class="grayscale grayscale-fade wp-post-image ral-mugshot">

When using a base image at http://s3-eu-west-1.amazonaws.com/rallyagency/princess-leia-princess-leia-walking-in-new-york-is-just-plain-awesome.jpeg, my template outputs this:

<img src="http://s3-eu-west-1.amazonaws.com/rallyagency/_200x200_crop_center-center_75/princess-leia-princess-leia-walking-in-new-york-is-just-plain-awesome.jpeg?mtime=20141217123237" width="200" height="200" alt="A photograph of Ali Meredith" class="grayscale grayscale-fade wp-post-image ral-mugshot">

Note the addition of the directory _200x200_crop_center-center_75 in the path - that doesn't exist on the S3 bucket.

1

If I recall, they should get created on S3 and also cached locally.

But if I try to load https://s3-eu-west-1.amazonaws.com/rallyagency/_200x200_crop_center-center_75/princess-leia-princess-leia-walking-in-new-york-is-just-plain-awesome.jpeg?mtime=20141217123237 directly, I'm getting an "Access Denied" error, so it looks like you've got some S3 permission issues.

3
  • Yes exactly. I've got a policy set for public read access and I have a key set up for full access that Craft uses. Presumably the issue is with the key, not the public policy? – Russ Back Dec 23 '14 at 17:07
  • Thanks, Brad. Looks like my access key worked but wasn't up-to-date with the latest IAM setup in AWS. Now sorted. – Russ Back Dec 23 '14 at 21:17
  • Brad, what if we are using Cloudfront in conjunction with s3? In that case I don't think we would want craft caching the images, right? – David A McInnis Nov 5 '15 at 19:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.