Thumbnails in gallery not working

Hello everyone.

Nextcloud 10.0.1

I have trouble with the gallery app. I just see icons instead of the actual pictures in gallery. See screenshot.

In general pictures are no problem. The logfile says:

"app":"index","message":"Exception: {\"Exception\":\"OC\\\\PreviewNo
tAvailableException\",\"Message\":\"SVG mimetype cannot be rendered\",\"Code\":0,\"Trace\":\"#0
```

Someone has an idea how to solve this?

thanks and cheers
t.

Hi,

It appears that your server is not set up to handle the SVG mime type? What server are you using?

Hi grouchysysadmin2m.

It’s apache. So i have to add svg mime type somewhere? Shouldn’t that be done by the nextcloud application?

thanks and cheers
t.

I just added:

AddType image/svg+xml svg svgz
AddEncoding gzip svg

Does not seem to solve the problem. Any other suggestions? I have a gentoo system here. “svg” use flag is in imagemagick activated. So i don’t think it’s such a problem.

thanks and cheers
t.

Mime types for typically defined at the server level. I’m not very familiar with Apache any more, but I think you need to add “AddType image/svg+xml svg” to the httpd.conf file.

Tried that. Does not change anything. I don’t think it’s a mime thing. Do you have that working? If so, what OS + php version are you using?

thanks and cheers
t.

…oh and i don’t think the error log message i posted has something to do with it. Cleared the logfile and just called the gallery. Nothing in the log. Strange.

cheers
t.

Looks for me more like a php module is missing. Have you installed imagick?

Found the solution. I had Content-Security-Policy set in apache vhost which led to:

thumbnail.js?v=204291f…:146 Refused to load the image 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD//gA+Q1JFQVRPUjogZ2QtanBl…APtMH/AD3j/wC+xR9pg/57x/8AfYooo5UAfaYP+e8f/fYqK5uYDazYmj+438Y9KKKFFXA//9k=' because it violates the following Content Security Policy directive: "default-src 'self' 'unsafe-eval' 'unsafe-inline'". Note that 'img-src' was not explicitly set, so 'default-src' is used as a fallback.

Sorry for the noise.