1

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).

2 Answers 2

3

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.

1

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

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.