Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorVincent Petry <vincent@nextcloud.com>2022-04-05 16:39:16 +0300
committerGitHub <noreply@github.com>2022-04-05 16:39:16 +0300
commit40f6f602324e663b2e41dd4d7b5b947e55f4077b (patch)
tree3938dcc32cb27801e6d369773134784c76e1e7c5 /lib
parent1fbb58bf8e24e990f7d13b9a9c8cb0e29373a1b5 (diff)
parentb5c9189cfab736693c1edb8363d02c6b640c91c0 (diff)
Merge pull request #31829 from nextcloud/fix/exif-imaginary
Fix imaginary with rotated exif images
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Preview/Imaginary.php24
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,