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

One image, twice (or more) on page, same resize width, different clip settings -> first loaded image wins for all #23

Open
tpinne opened this issue Jul 5, 2022 · 2 comments
Assignees
Labels
question Further information is requested

Comments

@tpinne
Copy link

tpinne commented Jul 5, 2022

If you have the same image one or multiple times on the page with different clip settings and want to resize them to the same width, then the clip settings for the first loaded image by the browser will be used for all variants of this image.

Use case
You have one content block which shows an image in landscape. And another content block which shows an image in portrait. And you want to use a portrait portion of the same image. Or you create <picture> elements with art direction where you choose the same image multiple times but with different clip settings to get different aspect ratios for different viewports.
Because you are on a tablet you want both variants resized to 768px.
Then the first image which the browser tries to load generates the json file inside .jobs directory for the 768px image width with its clip settings.
When then the other image gets loaded, it will be loaded with the clip settings from the previous one, because the job files only account for width (and height) but not for the clip settings.

Ideally the clip settings would be somehow encoded into the job filenames because the clipping creates a different instance of the same image at the same width. But I don't know if that's possible. Fairly new to Kirby. It might be an error on my end that I'm missing something. But I don't think so, yet.

@mullema mullema self-assigned this Jul 6, 2022
@mullema
Copy link
Owner

mullema commented Aug 1, 2022

Hi @tpinne
Can you please provide an example blueprint/code snippet which shows the problem? I am not able to reproduce it.

@tpinne
Copy link
Author

tpinne commented Aug 10, 2022

I try to provide you with a more specific example + explanation in the coming days.

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

No branches or pull requests

2 participants