PR #58224 dropped the `$iconFile === null` guard around the app-specific
icon generation in getFavicon()/getTouchIcon(), so an uploaded custom
favicon was always overwritten by the generated, context-colored icon
whenever Imagick could produce an ICO/PNG.
Restore the guard so the generation path only runs as a fallback when no
custom favicon was uploaded, while keeping the improved Imagick
capability detection from #58224.
Assisted-by: ClaudeCode:claude-opus-4-8
Signed-off-by: Simon L. <szaimen@e.mail.de>
> Prior to PHP 8.0.0, imagedestroy() freed any memory associated with the image resource.
> As of 8.0.0, the GD extension uses objects instead of resources, and objects cannot be explicitly closed.
With PHP 8.5 this is deprecated and causes a deprecation warning!
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
The diff can be checked using: git diff --ignore-all-space --ignore-blank-lines
To see only the changes not related to blank lines.
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
- ImageManagerTest: inject IAppConfig mock, switch cachebuster assertions
from IConfig::getAppValue to IAppConfig::getAppValueInt, add
testGetImageSvgToSvg and testGetImageSvgToPng, update mockGetImage to
reflect the corrected getImage() logic
- ThemingControllerTest: update getImage and getManifest tests to use
IAppConfig::getAppValueString for MIME type and cachebuster lookups,
add testGetLogoOriginalFile for the extensionless-file MIME path
AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Anna Larch <anna@nextcloud.com>
PR #58224 introduced a raster→SVG conversion path in ImageManager::getImage()
that breaks display of custom theming images. The root cause is a three-part
bug chain:
1. getImage() attempted to convert raster images (PNG/JPEG) to SVG format,
which Imagick cannot do meaningfully and produces broken output.
2. getMimeType() returns 'application/octet-stream' for extensionless stored
files, so the Content-Type response header was wrong.
3. Stale .svg cache files persisted after image replacement, causing
subsequent requests to serve the wrong format.
Fix by:
- Restricting the Imagick conversion to SVG→PNG only (not raster→SVG)
- Reading the stored MIME type from IAppConfig for extensionless files in
ThemingController::getImage()
- Deleting .svg cache files in ImageManager::delete()
- Injecting IAppConfig into ImageManager and reading the cachebuster via
IAppConfig::getAppValueInt() so the URL returned after upload always
carries the freshly-incremented value (IConfig::getAppValue() can return
a stale cached value within the same request)
- Updating the FileInputField Vue component to use a reactive cacheKey ref
that increments on every upload, so the thumbnail refreshes even when the
MIME type of the new image is the same as the old one
AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Anna Larch <anna@nextcloud.com>
Keeps old design with stronger constrast between background color and
background for high contrast themes.
Fixes: #55508
Signed-off-by: Jonas <jonas@freesources.org>