]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix preview generation for office documents 30971/head
authorJonas Meurer <jonas@freesources.org>
Wed, 2 Feb 2022 10:57:17 +0000 (11:57 +0100)
committerJonas Meurer <jonas@freesources.org>
Wed, 2 Feb 2022 11:02:04 +0000 (12:02 +0100)
`new \imagick()` returns an object, but we need the image blob (binary
string) from this object.

This is a partial backport of #26531, which brings a lot of refactoring
but also contains the fix.

Fixes: #29956
Signed-off-by: Jonas Meurer <jonas@freesources.org>
lib/private/Preview/Office.php

index fef218823e21d42e30dc4c63e38069ecbb443c78..50c016737ece94569f9b3083bb9ab8e15a976f46 100644 (file)
@@ -74,7 +74,7 @@ abstract class Office extends ProviderV2 {
                }
 
                $image = new \OC_Image();
-               $image->loadFromData($png);
+               $image->loadFromData((string) $png);
 
                $this->cleanTmpFiles();
                unlink($pngPreview);