<p>Focal Points apply to the Asset itself; that way the same Focal Point can be used with any transform, and it'll still keep the same point of interest centered when the image is transformed.</p>

<p>It should use the Focal Point automatically, you shouldn't have to do anything other than set it in the image editor.</p>

CC BY-SA 3.0
2018-01-13T22:39:45.877Z
2018-01-13T22:39:45.877Z
andrew.welch
<p>Ok i found out you need to set the crop height also (as well as width), then it worked.</p>

CC BY-SA 3.0
2018-01-15T12:28:32.697Z
2018-01-15T12:28:32.697Z
Spotd
<p>I can call predefined image transforms no problem - </p>

<pre><code>$image-&gt;getUrl('small')
</code></pre>

<p>but cropped mobile transforms need to use the image asset's set focal point (from the Image Editor). I can't find any example of how to use this feature in code? </p>

<p>I assume the only way to use this focal point is setting a new transform array in PHP? (i.e. the preset values are ignored).</p>

<p>Be good if there was an option to use the Image Focal point in the Transform setup (UI).</p>

<image-transforms><plugin-elementapi>
Image transform with focal point - in Element API
# Image transform with focal point - in Element API

(Asked by: username_0 on 2018-01-13)

I can call predefined image transforms no problem - 
$image->getUrl('small')

but cropped mobile transforms need to use the image asset's set focal point (from the Image Editor). I can't find any example of how to use this feature in code? 
I assume the only way to use this focal point is setting a new transform array in PHP? (i.e. the preset values are ignored).
Be good if there was an option to use the Image Focal point in the Transform setup (UI).

**Tags:** image-transforms, plugin-elementapi

---

## 2 answers

### Answer by username_1 on 2018-01-13. Score: 3 | Accepted answer

Focal Points apply to the Asset itself; that way the same Focal Point can be used with any transform, and it'll still keep the same point of interest centered when the image is transformed.

It should use the Focal Point automatically, you shouldn't have to do anything other than set it in the image editor.


---

### Answer by username_0 on 2018-01-15. Score: 1

Ok i found out you need to set the crop height also (as well as width), then it worked.


---

