data-hub
data-hub copied to clipboard
[Bug]: Retrieving thumbnail URLs via GraphQL API triggers thumbnail generation
Expected behavior
Calling fullpath
with a thumbnail
parameter on an asset
type via GraphQL should only return the URL for that thumbnail, without generating that thumbnail if it does not yet exist. Thumbnail generation should be deferred (see also https://pimcore.com/docs/pimcore/current/Development_Documentation/Assets/Working_with_Thumbnails/Image_Thumbnails.html#page_Deferred-Rendering-of-Thumbnails).
Actual behavior
Generating the thumbnail URLs appears to trigger the generation of the requested thumbnails, resulting in high response times and server load.
Steps to reproduce
Perform any GraphQL query that returns an asset and include fullpath(thumbnail: "any_previously_unused_thumbnail_type")
.
On the public demo server at https://demo.pimcore.fun/admin/ this can be reproduced by creating a new Thumbnail type called "my_thumbnail" that (for example) resizes the image, and running this GraphQL query:
{
getAssetFolder(fullpath: "/Car Images/vw/") {
children {
... on asset {
thumbnail:fullpath(thumbnail: "my_thumbnail")
}
}
}
}
kind of wanted behavior. we need to provide an additional request option to specify if thumbnail generation should be deferred or not
Thanks a lot for reporting the issue. We did not consider the issue as "Pimcore:Priority", "Pimcore:ToDo" or "Pimcore:Backlog", so we're not going to work on that anytime soon. Please create a pull request to fix the issue if this is a bug report. We'll then review it as quickly as possible. If you're interested in contributing a feature, please contact us first here before creating a pull request. We'll then decide whether we'd accept it or not. Thanks for your understanding.