diff options
author | Vincent Petry <vincent@nextcloud.com> | 2022-04-05 16:39:16 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-05 16:39:16 +0300 |
commit | 40f6f602324e663b2e41dd4d7b5b947e55f4077b (patch) | |
tree | 3938dcc32cb27801e6d369773134784c76e1e7c5 | |
parent | 1fbb58bf8e24e990f7d13b9a9c8cb0e29373a1b5 (diff) | |
parent | b5c9189cfab736693c1edb8363d02c6b640c91c0 (diff) |
Merge pull request #31829 from nextcloud/fix/exif-imaginary
Fix imaginary with rotated exif images
-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, |