Open cortix opened 1 year ago
Hi!
Not strictly related to your question, but it looks like you copy-pasted the example configs - they aren't really meant for that. There's a lot of "demonstrational" noise in there, such as most of the attributes. You don't actually need any configuration at all to use JPT; everything has sensible defaults so you only need to set the things you want changed.
The image selection probably has to do with the sizes
attribute. You didn't share it but I'll assume you're using the default preset (something like {% picture forloops.png %}
), and I see an auto-sizes attribute added on. Could your lazyloading library be attempting to generate a sizes attribute and failing? By my read of your code, it should be selecting the 800 pixel image for screens wider than the tablet
media query. Weird that you're getting something else!
Here's our docs on the sizes
attribute, maybe look through that and see if it makes sense.
You're right. I copy-pasted from the example configs. I tried to understand by trial-and-error. My goal was to see what output I would get. As you mentioned, choosing the 200pixel one, while it should have chosen the 800 pixel one, was odd for me.
Actually what I want to do is to create webp and original images suitable for every media format and add lazy loading feature to these images.
The image selection probably has to do with the sizes attribute. You didn't share it but I'll assume you're using the default preset (something like {% picture forloops.png %}),
It was like this;
{% picture 2022-02-23-imperative-and-declarative-programming/forloops.png --alt for loops example %}
and I see an auto-sizes attribute added on.
By the way, when I remove this data-sizes="auto"
, the problem has gone.
But I don't really understand why this feature is causing the error. Nevertheless, thank you very much.
I am taking an interesting error on 27 inc monitor. Maybe I'm doing something wrong but I wanted to share it anyway. Smallest image shows up on wide screen. First of all, I want to share what I did.
_config.yml
picture.yml
by using inspect element I am getting this
also in the _site folder, picture tag shows up like this;
these are generated pictures;
finally I took a screenshot video to make this problem clear :) https://youtu.be/CJ9UZuCAsvg
What do you think is the cause of this problem? I hope I made myself clear.
Best Regards.