Craft-FocusPoint
Craft-FocusPoint copied to clipboard
Focus Point coordinates lost if eager loaded?
When I eager load a focus point asset the output image no longer crops around the focal point, but if I revert back to lazy loading it works as expected?
In the below code, listingImage is a focuspoint field.
{% set workItemsEager = craft.entries({ section: 'work', limit: 8, with: [ 'listingImage', ] }) %}
{% set transformedImages = craft.imager.transformImage(image,[ { width: 500, height: 500, jpegQuality: 60 }, { width: 320, height: 320, jpegQuality: 60 }, ],{ allowUpscale: false, mode: 'crop', position: image.focusPctX ~ '% ' ~ image.focusPctY ~ '%', interlace: true }) %}
When outputting a transformed image from this code, the position is ignored. If I remove the "with" lines the focus point is retained.
To clarify, it looks like I still have access to image.focusPctX and image.focusPctY when eager loaded, but the value reported is incorrect, it appears to be centered?
+1 for this issue. Having the same problem when trying to use it on eager loaded elements.
Did anyone come up with a solution for this issue?
@MattWilcox Did you manage to resolve this at all?