How can I show a smaller thumb of the avatar picture for the logged in user, using the new methods?
You can still use the
thumb helper and pass the
Media object to it.
<?php if($user = $site->user()): ?> <?php echo thumb($site->user()->avatar(), array('width' => 50, 'height' => 50)); ?> <?php endif; ?>
shows the avatar picture (
*.jpg) in the original size (100px × 120px).
Something is wrong.
In the avatar directory I now find a new file called
*.dfm. This is the same file (format: jpg) as the avatar file only with a different file extension.
That is very strange. What is the HTML code you get from the PHP code you posted above? Does it point to that dfm file or to the original?
Also I have no idea why the file gets the extension
.dfm, that’s very very strange.
<img src="http://127.0.0.1:61080/kirby_basic/assets/avatars/username.jpg" alt="username">
OK, so that’s the original image, which is even more strange.
Did the same code work on your machine with Kirby 2.2.3?
Yes, with Kirby-Version 2.2.3 the same code runs and shows a picture with 42px × 50px from the thumbs directory.
Thanks for testing. I have created an issue.
But look at https://forum.getkirby.com/t/kirby-2-3-0-beta/3809/13?u=heineref too.
I don’t know but may be the change of the type of the user avatars from Media to File may help in this case.