0

Why do i get an error

throw new Exception(Craft::t('Image “{file}” cannot be found.', array('file' => $file->filename)));

for

{% set myImage = entry.pr_foto.first %}
{% set params = { width: 300, height: 200 } %}
<img  src="{{ myImage.getUrl(params) }}" height="{{ myImage.getHeight(params) }}" width="{{ myImage.getWidth(params) }}" alt="">

while

{% set myImage = entry.pr_foto.first %}
<img src="{{ myImage.url }}">

shows the image?

The filesystem path for photos is uploads/photos/. The upload works fine in the admin. It's only the transform.

Full trace error: enter image description here

2
  • Can you share the full stack trace of the error?
    – Brad Bell
    Dec 1, 2015 at 23:00
  • - your source image might be missing in this environement. - your image path might be wrong. - your image transform might be missing and craft thinks the transform has already been made. (if thats the case empty the table 'craft_assettransformindex' so all transforms will be recreated)
    – KSPR
    Dec 2, 2015 at 14:55

1 Answer 1

1

As i was working on a localised website I had to use the full path, in my case on MAMP PRO that was: /Users/davedriesmans/Documents/Sites/website.dev/public/uploads/photos/

guess i'll have to change then when going into production

use environmentVariables like Mats Mikkel Rummelhoff suggests

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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