Skip to content
Closed
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
Fix svg images not supported by imaginary autorotate
Signed-off-by: Michael Gruschwitz <[email protected]>
  • Loading branch information
grusch-it committed Dec 19, 2022
commit c380d97069be6c2684fa6d9c9024c35d08879532
28 changes: 14 additions & 14 deletions lib/private/Preview/Imaginary.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,20 +92,20 @@ public function getCroppedThumbnail(File $file, int $maxX, int $maxY, bool $crop

$quality = $this->config->getAppValue('preview', 'jpeg_quality', '80');

$operations = [
[
'operation' => 'autorotate',
],
[
'operation' => ($crop ? 'smartcrop' : 'fit'),
'params' => [
'width' => $maxX,
'height' => $maxY,
'stripmeta' => 'true',
'type' => $mimeType,
'norotation' => 'true',
'quality' => $quality,
]
$operations = [];
if (!in_array($file->getMimeType(), ['image/svg+xml', 'image/svg'])) {
$operations[]['operation'] = 'autorotate';
}

$operations[] = [
'operation' => ($crop ? 'smartcrop' : 'fit'),
'params' => [
'width' => $maxX,
'height' => $maxY,
'stripmeta' => 'true',
'type' => $mimeType,
'norotation' => 'true',
'quality' => $quality,
]
];

Expand Down