svg support for imagick
Pull Request #575 has solved adding imagick manually to the container - thank you for this! - but imagick is missing SVG Support. After changing my custom docker image back to the default (nextcloud:15-fpm-alpine), I am now stuck with the blue default favicons. My custom image showed the current app icon with the themed background.
Since I am new to this docker game, I cannot implement this change myself (I basically copy-pasted my code from the example docker files)
- What packages can I add manually to enable SVG support in imagick?
- What changes are needed in the official docker file to add support for SVG?
- Is SVG support something that should be added for everyone (i.E. official docker file) or should it be optional (i.E. add an example in the documentation) ?
You need to add libmagickcore-6.q16-3-extra to your image. This will add support for additional formats, including svg, to imagemagick.
For example change the part in the example where all the apt-get installs happen, to include this package:
RUN set -ex; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
ffmpeg \
smbclient \
supervisor \
# svg support
libmagickcore-6.q16-3-extra \
; \
rm -rf /var/lib/apt/lists/*
There's an ongoing discussion in https://github.com/nextcloud/server/issues/13099
Do you think we could publish another flavor with svg support and notice the user about the security concerns?
~~I think this does only affect Debian based images, so I filled #634 for consistency.~~
Looks like this does actually require the imagemagick binary. I've added this to the full example in #634, but I think it's not worth adding this by default (nextcloud/server#13099). You can easily convert the favicon locally to a PNG.
My point is that if it is "not worth" adding the package by default, why is the pecl extension being installed? As outlined, the extension shows loaded, but with no supported file formats. It used to be that neither the PECL extension or the imagemagick package were included. I have a derived image that I maintain with the added functionality here.
I used to have to add support for imagemagick, until I saw that starting with version 15, both the package and the extension were being included. Not so with 16 tho.
My point is that if it is "not worth" adding the package by default, why is the pecl extension being installed?
pecl extension "imagemagick" is installed by default. svg support for imagemagick is optional and not installed by default.
AFAIK imagick is used to speed up thumbnail generation and the imagemagick binary is used for extended file formats like SVG and PDF.
In nextcloud 17, imagemagick svg support is used to convert various elements like folder icons. the package is missing in the official nextcloud:17-fpm image. The folders and my logo were black after the upgrade to 17.
my workaround:
docker-compose exec nextcloud bash
apt install libmagickcore-6.q16-6-extra
./occ repair # clean frontend caches
docker-compose restart
Thanks, I will try something like this in my fpm-alpine image.
Actually it seems my problem is a little bit different. The SVG "seems" like it is being rendered but it is incorrectly rendered. I have checked the logs and are not able to see any helpful errors that would point to missing libs or the sort.
SVG Logo:

What it actually renders:

You need to add libmagickcore-6.q16-3-extra to your image. This will add support for additional formats, including svg, to imagemagick.
For example change the part in the example where all the apt-get installs happen, to include this package:
RUN set -ex; \ \ apt-get update; \ apt-get install -y --no-install-recommends \ ffmpeg \ smbclient \ supervisor \ # svg support libmagickcore-6.q16-3-extra \ ; \ rm -rf /var/lib/apt/lists/*
thanks
The standard container, without any additional apps, is now complaining about the lack of svg-support for php-imagick, so it might be a good idea to add this after all, even if it is just to ged rid of this suggestion.
Yeah, either the warning needs to go or the svg-support needs to be built in. It's unreasonable to expect people to build their own images.
Imagick's svg renderer is exactly why imagick is not recommended due to security vulnerabilities in the svg javascript processor.
svg support should be added, it's required by nextcloud to work properly
The container with the Tag 21 is also complaining about the missing imagick svg support...+1 for adding it again...please reopen (maybe pin) the issue to avoid duplikats...
AFAIK the imagemagick binary is only used to convert SVG favicons (using only default configs). Do I miss something?
If it is not intended to be supported or included due to vulnerabilities, there should be no use of it or reference to it in the app. This is a rather old issue for me.
@J0WI will this commit also fix the :21 Tag? =)