You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But I’m failing to find any more information on this.
All I can see is I have commands in my history to check which version of gd/freetype is linked to my PHP build. So I can only advise to test the result of imagettfbbox and compare it accross PHP versions and setups.
Still an issue on NC 27.0.1 tried below and cleared cache still an issue
# cd into your appdata avatar directory
cd data/appdata_xxxxx/avatar
# look for generated avatar and delete their containing directory
find -name 'generated' -type f -execdir pwd \; | xargs -d '\n' rm -rfv
# update file cache to make Nextcloud generate them again on demand
occ files:scan-app-data avatar
The problem is in ImageMagick itself; before ImageMagick 6.9.10-36 (specifically, ImageMagick/ImageMagick6@3b6ba12), if the internal renderer is used (that is, if ImageMagick is built with --without-rsvg and Inkscape is not in $PATH), the SVG used for avatars in Nextcloud is not properly rendered.
To check this, first save the SVG of a Nextcloud avatar in a test.svg file:
Then, build ImageMagick 6.9.10-35 and 6.9.10-36 and check the generated PNG file (note that you will need to replace {PATH-TO-THE-DIRECTORY-OF-THE-TEST-SVG-FILE} with the proper value):
To solve the issue you need to update ImageMagick to, at least, ImageMagick 6.9.10-36. If you are using Ubuntu 20.04 you can upgrade to Ubuntu 22.04, which uses ImageMagick 6.9.11-60 and therefore no longer has this issue.
ImageMagick renders SVG files using either its internal render, rsvg-convert or Inkscape, so if you are in an old ImageMagick version and you can not update it you might be able to work around the issue just installing Inkscape.
Alternatively, if your distributon provides SVG support for ImageMagick in an additional package (for example, libmagickcore-6.q16-6-extra in Ubuntu 20.04), you can also remove that package to remove support for SVG from ImageMagick; GD will be used instead of ImageMagick to generate the avatars and they will look as expected. The drawback is, however, that you may lose some other feature that depend on SVG support in ImageMagick, like theming icons.
Finally, note that the rendering was wrong too with the old avatar style, but since Nextcloud 16 the problem was not visible because the font could not be found (the path to the font was not updated when lib/private/Avatar.php was moved to lib/private/Avatar/Avatar.php) and thus it always ended being rendered with GD; with the new avatar style the path got fixed and thus the problem appeared.
Activity
[-][Bug]: Avatar New style logs weird[/-][+][Bug]: Avatar New style looks weird[/+]AndyXheli commentedon Sep 19, 2022
Not fixed in NC 25 Beta 7
Same results
CarlSchwan commentedon Sep 19, 2022
Oh now I see the issue, it wasn't about dark theme but the weird border
AndyXheli commentedon Sep 19, 2022
Let me know if you have a manual patch you'd like to me test out
AndyXheli commentedon Sep 26, 2022
Hello still having this issue on NC 25 RC1
18 remaining items
skjnldsv commentedon Nov 24, 2022
@come-nc ring a bell? Maybe a difference in parameters between 8.0 and 8.1?
AndyXheli commentedon Nov 24, 2022
come-nc commentedon Nov 28, 2022
Hum, kind of. I remember having a problem with gd or imagick changing result is some PHP version.
come-nc commentedon Nov 28, 2022
I have this test script left over on my disk, which indicates I did have trouble with this:
But I’m failing to find any more information on this.
All I can see is I have commands in my history to check which version of gd/freetype is linked to my PHP build. So I can only advise to test the result of
imagettfbboxand compare it accross PHP versions and setups.come-nc commentedon Nov 28, 2022
Here is what I have locally:
And with my PHP 8.2 built from source for tests:
So there is a 1 pixel difference between my 2 local versions already.
szaimen commentedon Nov 28, 2022
Interesting! So is the issue maybe only reproducible on php 8.0 and below?
come-nc commentedon Nov 28, 2022
No I think it depends upon which gd and/or freetype version is used. We need to test on as many setups as possible to see common patterns.
AndyXheli commentedon Jan 17, 2023
Still an issue on NC 25.0.3
schiessle commentedon Mar 27, 2023
In case some of the devs need a instance to reproduce it. The problem also exists on the LTD's on try.nextcloud.com
AndyXheli commentedon Mar 29, 2023
AndyXheli commentedon Jun 14, 2023
Still an issue NC 27
AndyXheli commentedon Jul 20, 2023
Still an issue on NC 27.0.1 tried below and cleared cache still an issue
danxuliu commentedon Jul 28, 2023
The problem is in ImageMagick itself; before ImageMagick 6.9.10-36 (specifically, ImageMagick/ImageMagick6@3b6ba12), if the internal renderer is used (that is, if ImageMagick is built with
--without-rsvgand Inkscape is not in $PATH), the SVG used for avatars in Nextcloud is not properly rendered.To check this, first save the SVG of a Nextcloud avatar in a test.svg file:
Then, build ImageMagick 6.9.10-35 and 6.9.10-36 and check the generated PNG file (note that you will need to replace
{PATH-TO-THE-DIRECTORY-OF-THE-TEST-SVG-FILE}with the proper value):To solve the issue you need to update ImageMagick to, at least, ImageMagick 6.9.10-36. If you are using Ubuntu 20.04 you can upgrade to Ubuntu 22.04, which uses ImageMagick 6.9.11-60 and therefore no longer has this issue.
ImageMagick renders SVG files using either its internal render, rsvg-convert or Inkscape, so if you are in an old ImageMagick version and you can not update it you might be able to work around the issue just installing Inkscape.
You could also rebuild ImageMagick with RSVG support, so it renders the SVG files through rsvg-convert rather than its internal renderer. However it seems that rsvg-convert has its own issues and it is not currently used when generating the avatars.
Alternatively, if your distributon provides SVG support for ImageMagick in an additional package (for example,
libmagickcore-6.q16-6-extrain Ubuntu 20.04), you can also remove that package to remove support for SVG from ImageMagick; GD will be used instead of ImageMagick to generate the avatars and they will look as expected. The drawback is, however, that you may lose some other feature that depend on SVG support in ImageMagick, like theming icons.Finally, note that the rendering was wrong too with the old avatar style, but since Nextcloud 16 the problem was not visible because the font could not be found (the path to the font was not updated when lib/private/Avatar.php was moved to lib/private/Avatar/Avatar.php) and thus it always ended being rendered with GD; with the new avatar style the path got fixed and thus the problem appeared.