nextcloud/apps/theming/src
Anna Larch 8a0080cbbb fix(theming): fix broken custom images introduced in 32.0.9
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>
2026-05-07 19:40:49 +02:00
..
components fix(theming): fix broken custom images introduced in 32.0.9 2026-05-07 19:40:49 +02:00
composables refactor(theming): migrate to Typescript and Vue 3 2025-12-23 17:00:40 +01:00
utils refactor(theming): migrate to Typescript and Vue 3 2025-12-23 17:00:40 +01:00
views chore: fix vue/attribute-hyphenation ESLint rule 2026-01-25 23:47:39 +01:00
settings-admin.ts refactor(theming): migrate to Typescript and Vue 3 2025-12-23 17:00:40 +01:00
settings-personal.ts refactor(theming): migrate to Typescript and Vue 3 2025-12-23 17:00:40 +01:00
theming.ts refactor(theming): move from js/ to src/ 2026-01-13 18:47:28 +01:00
types.d.ts refactor(theming): migrate to Typescript and Vue 3 2025-12-23 17:00:40 +01:00