Score:3

Derive all image styles when user uploading

cn flag

I have several image styles defined but only thumbnail and medium styles(images) can be derived from the original image.

I know those two styles are set in the "manage field" of image and my usage is not going to switch thumbnail nor medium to other styles. My use-case is to generate all styles when/after users upload.

Please help, Thanks!

Score:3
de flag

I believe that the Image Style Warmer module is what you want.

The Image Style Warmer module provides options to create image styles during upload or via queue worker. So configured image derivates already exists when they are requested.

  • Pre-generate configured image styles on image upload or crop change.
  • Pre-generate configured image styles via queue worker.
cn flag
Thank you for answering. This is an old system of the company and it doesn't have this module but somehow the production will generate all styles after the user clicks the save button. We do have the flysystem installed and I believe my local is in the same branch as our production.
Jaypan avatar
de flag
I don't understand what you're asking.
cn flag
Is there any way to achieve the functionality without installing the "warmer" module?
Jaypan avatar
de flag
You an look at how that module does it, and incorporate the methodology into your module.
cn flag
Thanks! Good to know.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.