diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Preview/Imaginary.php | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/lib/private/Preview/Imaginary.php b/lib/private/Preview/Imaginary.php index 7e6ce86d4eb..4da88f1ab26 100644 --- a/lib/private/Preview/Imaginary.php +++ b/lib/private/Preview/Imaginary.php @@ -89,18 +89,26 @@ class Imaginary extends ProviderV2 { $mimeType = 'jpeg'; } - $parameters = [ - 'width' => $maxX, - 'height' => $maxY, - 'stripmeta' => 'true', - 'type' => $mimeType, + $operations = [ + [ + 'operation' => 'autorotate', + ], + [ + 'operation' => ($crop ? 'smartcrop' : 'fit'), + 'params' => [ + 'width' => $maxX, + 'height' => $maxY, + 'stripmeta' => 'true', + 'type' => $mimeType, + 'norotation' => 'true', + ] + ] ]; - try { $response = $httpClient->post( - $imaginaryUrl . ($crop ? '/smartcrop' : '/fit'), [ - 'query' => $parameters, + $imaginaryUrl . '/pipeline', [ + 'query' => ['operations' => json_encode($operations)], 'stream' => true, 'content-type' => $file->getMimeType(), 'body' => $stream, |