Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Focus Point coordinates lost if eager loaded? #22

Open
MattWilcox opened this issue Oct 12, 2017 · 4 comments
Open

Focus Point coordinates lost if eager loaded? #22

MattWilcox opened this issue Oct 12, 2017 · 4 comments

Comments

@MattWilcox
Copy link

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.

@MattWilcox
Copy link
Author

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?

@jan-dh
Copy link

jan-dh commented Feb 5, 2018

+1 for this issue. Having the same problem when trying to use it on eager loaded elements.

@terryupton
Copy link

Did anyone come up with a solution for this issue?

@terryupton
Copy link

@MattWilcox Did you manage to resolve this at all?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants