Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preview of Office document is again not possible #29956

Closed
SKB-CGN opened this issue Nov 29, 2021 · 2 comments
Closed

Preview of Office document is again not possible #29956

SKB-CGN opened this issue Nov 29, 2021 · 2 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug feature: previews and thumbnails

Comments

@SKB-CGN
Copy link

SKB-CGN commented Nov 29, 2021

Hi,
after upgrading to Nextcloud 22.2.3 - there is again the problem, that no office preview is created.

Following errors are appearing:

Error core ImagickException: unable to open image '/tmp//Address.png': No such file or directory @ error/blob.c/OpenBlob/3533
Error PHP Error: unlink(/tmp//Address.png): No such file or directory at /usr/local/www/nextcloud/lib/private/Preview/Office.php#66

Seems, that the instance-id or the folder is not returned properly.

@mejo-
Copy link
Member

mejo- commented Feb 1, 2022

Nextcloud 23 contains PR #26531, which fixes preview generation for office files. The relevant change is this oneliner.

To those who suffer from this bug on Nextcloud 22, could you try patching lib/private/Preview/Office.php the following way and report back whether it fixes the issue for you:

index fef218823e..50c016737e 100644
--- a/lib/private/Preview/Office.php
+++ b/lib/private/Preview/Office.php
@@ -74,7 +74,7 @@ abstract class Office extends ProviderV2 {
                }
 
                $image = new \OC_Image();
-               $image->loadFromData($png);
+               $image->loadFromData((string) $png);
 
                $this->cleanTmpFiles();
                unlink($pngPreview);

mejo- added a commit that referenced this issue Feb 2, 2022
`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>
mejo- added a commit that referenced this issue Feb 2, 2022
`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>
mejo- added a commit that referenced this issue Feb 2, 2022
`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>
@mejo-
Copy link
Member

mejo- commented Feb 2, 2022

This is already fixed in Nextcloud 23 by #26531 and now also in Nextcloud 22 by #30971 (will be shipped with the upcoming point releases).

@mejo- mejo- closed this as completed Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug feature: previews and thumbnails
Projects
None yet
Development

No branches or pull requests

3 participants