server
server copied to clipboard
[Bug]: occ theming:config favicon "/root/nc.ico" Unsupported image type for .ico and .png
⚠️ This issue respects the following points: ⚠️
- [X] This is a bug, not a question or a configuration/webserver/proxy issue.
- [X] This issue is not already reported on Github OR Nextcloud Community Forum (I've searched it).
- [X] Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- [X] I agree to follow Nextcloud's Code of Conduct.
Bug description
setting favicon doesnt work: occ theming:config favicon "/root/nc.ico"
it tells me:
In ImageManager.php line 233:
Unsupported image type
theming:config [-r|--reset] [--] [<key> [<value>]]
also happens with .png and .svg..
Steps to reproduce
- having an ico-file named nc.ico inside /root
- running this: occ theming:config favicon "/root/nc.ico"
Expected behavior
it sets my icon as the favicon
Installation method
Community SNAP package
Nextcloud Server version
25
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.1
Web server
Apache (supported)
Database engine version
MySQL
Is this bug present after an update or on a fresh install?
Fresh Nextcloud Server install
Are you using the Nextcloud Server Encryption module?
None
What user-backends are you using?
- [ ] Default user-backend (database)
- [X] LDAP/ Active Directory
- [X] SSO - SAML
- [ ] Other
Configuration report
No response
List of activated Apps
No response
Nextcloud Signing status
No response
Nextcloud Logs
No response
Additional info
No response
You can use an ICO file if the mime type is image/x-icon or image/vnd.microsoft.icon. Your file has a different mime type and therefor the exception.
You can use an ICO file if the mime type is image/x-icon or image/vnd.microsoft.icon. Your file has a different mime type and therefor the exception. the error occurs because I download the file from another nextcloud using wget. and even if I convert the ico back and forth (png - ico) using the convert command it wil still give me the same error.
also it works using the webinterface jsut not using .occ It would make it much easier for me to generally allow .ico files as it works in many other places.
I now even downloaded the current favicon on my nextcloud setup and used it using the occ commadn and it gives me the same error..
file --mime-type logo.ico
to print the mime type of the file.
nc.ico: image/vnd.microsoft.icon
and it does not work. "Unsupported image type"
The mime type looks correct. I just had a test with a random ico file. It works over here.
php -r "var_dump(mime_content_type('/path/to/your/file.ico'));"
You can run the snippet above. That's the same function we use internally to detect the mime type.
'));"
string(24) "image/vnd.microsoft.icon"
The mime type looks correct. I just had a test with a random ico file. It works over here.
php -r "var_dump(mime_content_type('/path/to/your/file.ico'));"
You can run the snippet above. That's the same function we use internally to detect the mime type.
maybe I need to move the file somehwere as I installed nextcloud as a snap-package?
I assume nextcloud.occ theming:config
won't work as you execute the command on the host, but the file is expected inside the container. But it should also lead to a different error message because the file does not exist :shrug:
Possibly the snaps confinement blocks the file_exists check from working correctly? Cc @kyrofa
Possibly the snaps confinement blocks the file_exists check from working correctly?
The favicon is in /root/nc.ico
? Assuming this is an Ubuntu-based distro and it's properly confined, yeah almost certainly. Try putting it in /var/snap/nextcloud/common/
somewhere.
works, not a bug