<p>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/</p>

<p>guess i'll have to change then when going into production</p>

<p>use environmentVariables like Mats Mikkel Rummelhoff suggests</p>

CC BY-SA 3.0
2016-01-01T17:09:40.963Z
You can use [environmentVariables](https://craftcms.com/docs/multi-environment-configs#example-multi-environment-asset-source-settings) for Asset source paths - that way you won't have to change them every time you sync the databases between environments.
Mats Mikkel Rummelhoff
CC BY-SA 3.0
2015-12-02T15:33:29.870Z
2016-01-01T20:52:21.447Z
2016-01-01T20:52:21.447Z
Dave Driesmans
<p>Why do i get an error</p>

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

<p>for </p>

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

<p>while</p>

<pre><code>{% set myImage = entry.pr_foto.first %}
&lt;img src="{{ myImage.url }}"&gt;
</code></pre>

<p>shows the image?</p>

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

<p>Full trace error:
<a href="https://i.sstatic.net/bIDzR.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/bIDzR.png" alt="enter image description here"></a></p>

CC BY-SA 3.0
2015-12-01T23:00:31.897Z
Can you share the full stack trace of the error?
Brad Bell
CC BY-SA 3.0
2015-12-02T14:55:34.077Z
- 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
<image-transforms>
Transform: Image {file} cannot be found with
# Transform: Image {file} cannot be found with

(Asked by: username_0 on 2015-12-01)

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 } %}


while
{% set myImage = entry.pr_foto.first %}


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:

**Tags:** image-transforms

> **Comments:**
> **username_1**: Can you share the full stack trace of the error?  
> **username_2**: - 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)  

---

## 1 answers

### Answer by username_0 on 2015-12-02. Score: 1 | Accepted answer

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 username_3 suggests

> **Comments:**
> **username_3**: You can use [environmentVariables](https://craftcms.com/docs/multi-environment-configs#example-multi-environment-asset-source-settings) for Asset source paths - that way you won't have to change them every time you sync the databases between environments.  

---

