Thumbnail generation for remote asset store not working #16866
Unanswered
NoopNetwork
asked this question in
Q&A / Support
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
I implemented Microsoft OneDrive as an asset storage using shitware-ltd/flysystem-msgraph. Unfortunately, generation of thumbnails did not work. I tracked the problem back to Pimcore\Helper\TemporaryFileHelperTrait::getLocalFileFromStream($stream). On line 37, stream_is_local($stream) is used. However, flysystem-msgraph uses Guzzle and for whatever reason, the Guzzle stream to access the OneDrive URL is reported as a local stream.
I fixed the problem by changing line 37 from
if (!stream_is_local($stream) || (is_resource($stream) && stream_get_meta_data($stream)['uri'] === 'php://temp')) {
to
However, this obviously is a bit hacky. I have been trying to get the Guzzle stream to return false for stream_is_local() by implementing isLocal() in the Stream Wrapper, but that did not work. I am happy for any other ideas.
Maybe, it is worth looking at this check in TemporaryFileHelperTrait again for the core code base of Pimcore and implement this somehow differently.
Thank you!
Best,
Fabian
Beta Was this translation helpful? Give feedback.
All reactions