You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{# test 1 #}
{% setimg1= image.cropResize(1200,1200) %}
{{ img1.path() }} {# path to cropResize image #}
{{ img1.path() }} {# suddenly reset to original image #}{# test 2 #}
{% setimg1= image.cropResize(1200,1200) %}
{{ img1.get('width')|raw }} {# original width not expected cropResize #}
{{ img1.get('height')|raw }} {# original height not expected cropResize, but not resets the image #}
{{ img1.html()|raw }} {# outputs correct width and height #}
{{ img1.html()|raw }} {# suddenly reset to original image #}{# test 3 #}
{% setimg1= image.cropResize(1200,1200) %}
{{ img1.get('width')|raw }} {# original width not cropResize #}
{{ img1.get('height')|raw }} {# original height not cropResize #}
{{ img1.path()|getimagesize[0] }} {# correct width #}
{{ img1.path()|getimagesize[1] }} {# resets to original like test 1 #}{# test 4 #}
{{ image.cropResize(1200,1200).html()|raw }}
{{ image.cropResize(1200,1200).html()|raw }} {# correct file, not reset like in test 1 #}
Actually, html() and some other methods reset the image "by purpose". Also, the size of the image only changes only when the operations get applied. So the results are what I am expecting due to limitations in the implementation.
That said, I'm currently rewriting all of this logic for Grav 1.8; the size is now being calculated per operation, but I have not yet touched the reset behavior as I think it's being used in somewhere.
Environment
Grav: v1.7.31
Admin: v1.10.31
auto_sizes
is enabled.Example
Twig template
Output
Expected behavour
html()
is called twice like in test 2.width
andheight
should be from the modified image and not the original image.Related issues
enhancement
? ImageMedium methods don't update width/height parameters #1058The text was updated successfully, but these errors were encountered: