data-hub icon indicating copy to clipboard operation
data-hub copied to clipboard

[Bug]: Retrieving thumbnail URLs via GraphQL API triggers thumbnail generation

Open micheljansen opened this issue 2 years ago • 2 comments

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")
      }
    }
  } 
}

micheljansen avatar Apr 08 '22 12:04 micheljansen

kind of wanted behavior. we need to provide an additional request option to specify if thumbnail generation should be deferred or not

fashxp avatar Apr 19 '22 08:04 fashxp

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.

github-actions[bot] avatar Jan 20 '24 07:01 github-actions[bot]