nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.42k stars 4.07k forks source link

SVGs unsupported as login images (Theming) #10714

Closed va1entin closed 4 years ago

va1entin commented 6 years ago
### Steps to reproduce 1. Try to upload svg as login image in Settings -> Theming ### Expected behaviour SVGs can be used as login image ### Actual behaviour Red box `Unsupported image type` ### Server configuration **Operating system**: Official Nextcloud app in Ubuntu 16.04 container on UCS 4.3-1 **Web server:** 2.4.18-2ubuntu3.8 **PHP version:** PHP 7.0.30-0ubuntu0.16.04.1 **Nextcloud version:** 13.0.4 **Updated from an older Nextcloud/ownCloud or fresh install:** No **Where did you install Nextcloud from:** UCS App Center (Container) I suppose this is a known issue/limitation. If not and you need the other info to debug, I'll gladly supply it.
nextcloud-bot commented 6 years ago

GitMate.io thinks possibly related issues are https://github.com/nextcloud/server/issues/8241 (image), https://github.com/nextcloud/server/issues/9306 (Login Background Image Never Applied), https://github.com/nextcloud/server/issues/5035 (Theming: Background image), https://github.com/nextcloud/server/issues/4759 (Login image not shown in /settings/admin/theming), and https://github.com/nextcloud/server/issues/5085 (Theming background image fails for other trusted domains).

MorrisJobke commented 5 years ago

cc @nextcloud/theming

MorrisJobke commented 5 years ago

@juliushaertl Is this supported at all?

juliusknorr commented 5 years ago

Uploading SVG images is only possible if imagemagick on your setup has the capability of handling svg files. Can you check if those are available by running: identify -list format | grep SVG. This should output a list of supported SVG formats:

     MSVG  SVG       rw+   ImageMagick's own SVG internal renderer
      SVG  SVG       rw+   Scalable Vector Graphics (RSVG 2.44.13)
     SVGZ  SVG       rw+   Compressed Scalable Vector Graphics (RSVG 2.44.13)
MorrisJobke commented 5 years ago

As there is no report since a while and we can't reproduce the issue I will close this ticket. If this is still happening please feel free to reopen.

marius-wieschollek commented 4 years ago

@MorrisJobke I think i ran into this issue in NC18 RC1.

I can upload an SVG file as login image and will receive a successful "saved" message, but the image is not there since imagecreatefromstring can not handle svg files. Instead the background in the preview is empty and there are errors in the log.

ezgif com-optimize

{"reqId":"Lae8YGcI6tbDXn1DU89E","level":3,"time":"2020-01-04T23:43:47+00:00","remoteAddr":"172.20.0.1","user":"admin","app":"PHP","method":"POST","url":"/apps/theming/ajax/uploadImage","message":"imagesx() expects parameter 1 to be resource, bool given at /var/www/html/apps/theming/lib/Controller/ThemingController.php#290","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:71.0) Gecko/20100101 Firefox/71.0","version":"18.0.0.8","id":"5e11233449f7f"}
{"reqId":"Lae8YGcI6tbDXn1DU89E","level":3,"time":"2020-01-04T23:43:47+00:00","remoteAddr":"172.20.0.1","user":"admin","app":"PHP","method":"POST","url":"/apps/theming/ajax/uploadImage","message":"imagesy() expects parameter 1 to be resource, bool given at /var/www/html/apps/theming/lib/Controller/ThemingController.php#291","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:71.0) Gecko/20100101 Firefox/71.0","version":"18.0.0.8","id":"5e11233449eed"}
{"reqId":"Lae8YGcI6tbDXn1DU89E","level":3,"time":"2020-01-04T23:43:47+00:00","remoteAddr":"172.20.0.1","user":"admin","app":"PHP","method":"POST","url":"/apps/theming/ajax/uploadImage","message":"Division by zero at /var/www/html/apps/theming/lib/Controller/ThemingController.php#291","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:71.0) Gecko/20100101 Firefox/71.0","version":"18.0.0.8","id":"5e11233449e63"}
{"reqId":"Lae8YGcI6tbDXn1DU89E","level":3,"time":"2020-01-04T23:43:47+00:00","remoteAddr":"172.20.0.1","user":"admin","app":"PHP","method":"POST","url":"/apps/theming/ajax/uploadImage","message":"imagescale() expects parameter 1 to be resource, bool given at /var/www/html/apps/theming/lib/Controller/ThemingController.php#292","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:71.0) Gecko/20100101 Firefox/71.0","version":"18.0.0.8","id":"5e11233449e26"}
{"reqId":"Lae8YGcI6tbDXn1DU89E","level":3,"time":"2020-01-04T23:43:47+00:00","remoteAddr":"172.20.0.1","user":"admin","app":"PHP","method":"POST","url":"/apps/theming/ajax/uploadImage","message":"imageinterlace() expects parameter 1 to be resource, null given at /var/www/html/apps/theming/lib/Controller/ThemingController.php#294","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:71.0) Gecko/20100101 Firefox/71.0","version":"18.0.0.8","id":"5e11233449dde"}
{"reqId":"Lae8YGcI6tbDXn1DU89E","level":3,"time":"2020-01-04T23:43:47+00:00","remoteAddr":"172.20.0.1","user":"admin","app":"PHP","method":"POST","url":"/apps/theming/ajax/uploadImage","message":"imagejpeg() expects parameter 1 to be resource, null given at /var/www/html/apps/theming/lib/Controller/ThemingController.php#295","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:71.0) Gecko/20100101 Firefox/71.0","version":"18.0.0.8","id":"5e11233449d9a"}
{"reqId":"Lae8YGcI6tbDXn1DU89E","level":3,"time":"2020-01-04T23:43:47+00:00","remoteAddr":"172.20.0.1","user":"admin","app":"PHP","method":"POST","url":"/apps/theming/ajax/uploadImage","message":"imagedestroy() expects parameter 1 to be resource, null given at /var/www/html/apps/theming/lib/Controller/ThemingController.php#296","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:71.0) Gecko/20100101 Firefox/71.0","version":"18.0.0.8","id":"5e11233449d56"}
juliusknorr commented 4 years ago

@marius-wieschollek Please open a new issue as this one is only related to the logo when svg is not supported by imagemagick. I'd just not running the resize on svg images should be fine.