Hey, first of all, thanks for this module, which fills a fundamental gap. Unfortunately, I can't get it to run correctly.

After I have saved a new crop on an image, the itok token of the path does not change. As a result, the image is of course not reloaded after the crop has been changed. (The browser cache does not load it because the URL/itok does not change)

The token is created in /src/MediaContextualCropService.php : 203 and is based on the original image style. So as long as the non-contextual derivative has not been changed, this token will always remain the same.

Have I configured something wrong or can someone else confirm this?

CommentFileSizeAuthor
#4 media_contextual_crop-3536269-1.patch836 byteshauke-vq

Comments

hauke-vq created an issue. See original summary.

hauke-vq’s picture

Oh no. I've just realised that I got that wrong. Without Contextual Crop, I have an additional query parameter that updates when a crop is made. This does not exist on contextual cropped images.

I'm not very experienced with backend programming, so this is a bit difficult for me to figure out.

drdam’s picture

Status: Active » Postponed (maintainer needs more info)

That's a main issue

Can you be more precise with the site configuration (modules involved, configuration on image styles....), URL generated, some screen-shots...

Thanks

hauke-vq’s picture

StatusFileSize
new836 bytes

I have written a patch that solves my problem. But I am not completely sure if it is the correct approach.

I'll try to summarise the problem again:

For non-context-based crops, the URLs to the image styles have an additional query paramter ‘h’. This updates itself based on the crop and serves as a cache breaker for browsers/CDNs because the actual URL does not change.

drdam’s picture

Ok, it have been solved in an older version (with another controller), and I forgot to reapply it...

thanks

  • 82657524 committed on 2.1.x
    Issue #3536269 by hauke-vq: Image path does not update when setting a...
drdam’s picture

Status: Postponed (maintainer needs more info) » Fixed

fixed in 2.1.8

drdam’s picture

Status: Fixed » Closed (fixed)