Closed (outdated)
Project:
Image Effects
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
7 Apr 2016 at 21:05 UTC
Updated:
6 Sep 2020 at 10:31 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jfrederick commentedAnd a patch
Comment #3
mondrakeTokens are not my favorite playground, so I hope @Berdir or @slashrsm can review this.
The one thing that jumps out to me: the token replacement is done in the ::getTextWrapper method for a reason - it is called by both ::applyEffect and ::transformDimensions.
Now, ::applyEffect has an image object in input, but ::transformDimension has not - because the latter is meant to precalculate derivative image dimensions without the IO load that fetching an image object brings.
So, potentially this patch introduces the risk that the two methods will return different dimensions, which we should avoid.
An option could be, instead of passing the image object to the token context, to pass an associative array with the elements that may be used by the token system, like e.g. height, width, uri - and that to be taken from the image object in ::applyEffect, and from the passed arguments in ::transformDimensions.
Comment #4
mondraketagging
Comment #5
a_khalipau commentedPorted to the latest version.
Comment #6
mondrake