Drupal has a very powerful image manipulation UI, so why write code when we can easily use that for any purpose?!
The problem is we can't! The reason is image manipulation UI only accepts one argument which is the source image.
All other parameters and options are static. For example if you want to put the source image behind a frame you can,
but if you want to dynamically change frame's image you either have to make new preset/style for each different frame
or write a custom special action.
Another example is rendering texts dynamically, you can pass any text you want to the image style and have it rendered without writing any custom action
The ideal solution is proper argument support by drupal's core image module , something like Views arguments
Also it's not currently possible to use tokens or context in image styles/presets. One of the advantages of token support is to use parameters of the last effect
in the next one. For example we can scale an image by width and then use the new height size to crop image's width and height in the next effect. This also opens up the possibility
to have much smarter effects and combine them together like Color detector, it can detect the major colors used in an image and when can use the most used one as the image's background color or color filter!
Comments
Comment #1
theduke CreditAttribution: theduke commented+1 for dynamic arguments for image styles, this becomes important in various scenarios.
I needed this functionality on multiple sites.
Comment #2
rooby CreditAttribution: rooby commentedI assume this sandbox is relevant to this issue: https://www.drupal.org/sandbox/sinasalek/1715318
Comment #3
TechNikh CreditAttribution: TechNikh commented+1