nextcloud/apps/theming/lib
Anna Larch 638b2c20c6 fix(theming): fix broken custom images introduced by #58224
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
- Updating unit tests for ImageManager and ThemingController
- Updating psalm baseline for stable32

Backport of #60198

AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Anna Larch <anna@nextcloud.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2026-05-20 15:50:07 +00:00
..
AppInfo chore: apply new CSFixer rules 2025-07-01 16:26:50 +02:00
Command chore: apply new CSFixer rules 2025-07-01 16:26:50 +02:00
Controller fix(theming): fix broken custom images introduced by #58224 2026-05-20 15:50:07 +00:00
Jobs refactor(apps): Use constructor property promotion when possible 2024-10-21 12:37:59 +02:00
Listener refactor(apps): Use constructor property promotion when possible 2024-10-21 12:37:59 +02:00
Migration fix(theming): Do not throw in background color migration 2025-01-29 15:32:43 +01:00
Service feat(theming): add new default background for Nextcloud 32 2025-08-21 19:22:45 +02:00
Settings chore: apply new CSFixer rules 2025-07-01 16:26:50 +02:00
SetupChecks chore: Add SPDX header 2024-05-31 10:38:47 +02:00
Themes fix(ui): Update assistant text gradient 2025-09-25 12:48:04 +00:00
Capabilities.php chore: apply new CSFixer rules 2025-07-01 16:26:50 +02:00
ConfigLexicon.php fix(theming): use IAppConfig for all ThemingDefaults 2025-11-01 17:14:02 +00:00
IconBuilder.php fix(theming): Fix favicon and touchicon ratios 2026-04-07 12:00:06 +00:00
ImageManager.php fix(theming): fix broken custom images introduced by #58224 2026-05-20 15:50:07 +00:00
ITheme.php chore: Add SPDX header 2024-05-31 10:38:47 +02:00
ResponseDefinitions.php chore: Add SPDX header 2024-05-31 10:38:47 +02:00
ThemingDefaults.php fix: generate favourite icon without imagick svg support 2026-04-06 14:52:54 -04:00
Util.php fix: generate favourite icon without imagick svg support 2026-04-06 14:52:54 -04:00