<p>Kind of.  They currently aren't technically true "Assets" like in the rest of Craft.</p>

<p>The most you can do is pass in a size to the method <code>getPhotoUrl(45)</code> and you'll get a 45 x 45 square result back.  I believe it will crop from the center only.</p>

<p>We have plans for Craft 3 so they'll be treated like 1st class Assets and you'll be able to perform transforms on them like any other Asset.</p>

CC BY-SA 3.0
2015-07-28T10:31:18.550Z
Thanks for your help Brad but it doesnt actually crop it as you describe.  It does maintain a aspect ratio as i mentioned above as this is the first thing i tried.
Andy Lake
CC BY-SA 3.0
2015-07-28T16:40:05.447Z
I could be wrong about that... will clarify with @andris.
Brad Bell
CC BY-SA 3.0
2015-07-28T18:37:22.300Z
I assume this is all in the context of a front-end entry form, no?  In the CP, you get an actual cropper modal to use.
Brad Bell
CC BY-SA 3.0
2015-10-10T10:13:15.930Z
Correct, we're just printing the user photo and we want it to be 64x64 from the centre as you described above.
Andy Lake
CC BY-SA 3.0
2015-12-31T10:25:23.003Z
Has 2.5 managed to rectify this yet? Can we use transforms on user photos?
Andy Lake
CC BY-SA 3.0
2015-07-27T18:11:17.997Z
2015-07-27T18:11:17.997Z
Brad Bell
<p>Is it possible to do anything with Craft's <code>getPhotoUrl()</code> function to allow images to be processed in a similar way like assets?</p>

<p>For example for our profile photos I'd like them to be returned 45x45 cropped from centre. </p>

<p>Currently if a user were to upload a landscape photo they would see something like 45x25 because the height isn't being maintained.  </p>

<p>Thoughts?</p>

<users><user-profile><profile>
create a fixed height and width for profile photos
# create a fixed height and width for profile photos

(Asked by: username_0 on 2015-07-27)

Is it possible to do anything with Craft's `getPhotoUrl()` function to allow images to be processed in a similar way like assets?

For example for our profile photos I'd like them to be returned 45x45 cropped from centre.

Currently if a user were to upload a landscape photo they would see something like 45x25 because the height isn't being maintained.

Thoughts?

**Tags:** users, user-profile, profile


---

## 1 answers

### Answer by username_1 on 2015-07-27. Score: 2

Kind of. They currently aren't technically true "Assets" like in the rest of Craft.

The most you can do is pass in a size to the method `getPhotoUrl(45)` and you'll get a 45 x 45 square result back. I believe it will crop from the center only.

We have plans for Craft 3 so they'll be treated like 1st class Assets and you'll be able to perform transforms on them like any other Asset.

> **Comments:**
> **username_0**: Thanks for your help Brad but it doesnt actually crop it as you describe.  It does maintain a aspect ratio as i mentioned above as this is the first thing i tried.  
> **username_1**: I could be wrong about that... will clarify with @andris.  
> **username_1**: I assume this is all in the context of a front-end entry form, no?  In the CP, you get an actual cropper modal to use.  
> **username_0**: Correct, we're just printing the user photo and we want it to be 64x64 from the centre as you described above.  
> **username_0**: Has 2.5 managed to rectify this yet? Can we use transforms on user photos?  

---

