Commit 3551e61
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>1 parent ab6a1e6 commit 3551e61
3 files changed
Lines changed: 28 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
356 | 356 | | |
357 | 357 | | |
358 | 358 | | |
359 | | - | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
360 | 366 | | |
361 | 367 | | |
362 | 368 | | |
| |||
435 | 441 | | |
436 | 442 | | |
437 | 443 | | |
438 | | - | |
| 444 | + | |
439 | 445 | | |
440 | 446 | | |
441 | 447 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| 34 | + | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
| |||
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
43 | | - | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
| |||
85 | 87 | | |
86 | 88 | | |
87 | 89 | | |
88 | | - | |
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
92 | 93 | | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
113 | 98 | | |
114 | 99 | | |
115 | 100 | | |
| |||
120 | 105 | | |
121 | 106 | | |
122 | 107 | | |
123 | | - | |
| 108 | + | |
124 | 109 | | |
125 | 110 | | |
126 | 111 | | |
127 | 112 | | |
128 | 113 | | |
129 | | - | |
130 | 114 | | |
131 | 115 | | |
132 | 116 | | |
| |||
157 | 141 | | |
158 | 142 | | |
159 | 143 | | |
160 | | - | |
| 144 | + | |
161 | 145 | | |
162 | 146 | | |
163 | 147 | | |
| |||
214 | 198 | | |
215 | 199 | | |
216 | 200 | | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
217 | 207 | | |
218 | 208 | | |
219 | 209 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1030 | 1030 | | |
1031 | 1031 | | |
1032 | 1032 | | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
1033 | 1038 | | |
1034 | 1039 | | |
1035 | 1040 | | |
| |||
0 commit comments