Skip to content

Commit

Permalink
Fix preview generation for office documents
Browse files Browse the repository at this point in the history
`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>
  • Loading branch information
mejo- committed Feb 2, 2022
1 parent 4ea9050 commit 0b0ea3d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/private/Preview/Office.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function getThumbnail(File $file, int $maxX, int $maxY): ?IImage {
}

$image = new \OC_Image();
$image->loadFromData($png);
$image->loadFromData((string) $png);

$this->cleanTmpFiles();
unlink($pngPreview);
Expand Down

0 comments on commit 0b0ea3d

Please sign in to comment.