Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/theming/lib/ImageManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,6 @@ public function delete(string $key): void {
}

public function updateImage(string $key, string $tmpFile): string {
$this->delete($key);

try {
$folder = $this->getRootFolder()->getFolder('images');
} catch (NotFoundException $e) {
Expand All @@ -217,6 +215,8 @@ public function updateImage(string $key, string $tmpFile): string {
throw new \Exception('Unsupported image type: ' . $detectedMimeType);
}

$this->delete($key);

if ($key === 'background') {
if ($this->shouldOptimizeBackgroundImage($detectedMimeType, filesize($tmpFile))) {
try {
Expand Down
Loading