Hi all,
I'm trying to display a users profile image in a comments list and am not able to resize it.
The site is used as an intranet, so there are no guest-users allowed, all users are registered with a role "staff" and have a mandatory imagefield.
Using a multi-file image field, I tried the following code inside a function:
// who's the author?
$cite = $comment->getFormatted('cite');
// get the author and display profile picure (first in set)
$userImage = wire('users')->get($cite)->getUnformatted('images')->eq(0)->size(100,100)->url;
Without resizing, everything is fine:
// get the first image
$userImage = wire('users')->get($cite)->getUnformatted('images')->eq(0)->url;
// get the second image
$userImage = wire('users')->get($cite)->getUnformatted('images')->eq(1)->url;
works as expected.
I also tried a single-file field but without success either:
getting the original image URL works fine, resizing the image doesn’t.
Any ideas on that?