Wrong width and height #27
Replies: 3 comments 2 replies
-
Hi @pinpointconseil, Thank you for reaching out. I believe there seems to be a bit of confusion about how this library is supposed to work. Which tells me, I have to do a much better job explaining it in the docs. There are a couple of things, that strike me as odd at first glance, and I'd really appreciate if you could give me a little more information. Understanding your line of thought will help me improve the documentation.
Again, thanks for reaching out. Good documentation is key and with your help I believe we can make them much better. Best |
Beta Was this translation helpful? Give feedback.
-
Thank you for your reply.
I have cards with images inside. Each card is related to an object. I tried
to set a fixed width and height. I thought that setting the default values
for width_field and height_field would fix these objectives.
As it did not work, I tried to set them in css inline. This is why I put
them as attributes in the picture filter.
Certainly, I did not understand the usage of width_field, height_field,
setting default height and width for images at the upload stage.
My aim is to get pictures with fixed width and height when they are
displayed in any browser (depending if xs, sm, m or l) as I'm using
bootstrap grid.
Hope i have clarified my current usage.
Also, I can not understand how to use this module for static images (not
depending on django model)? if you can tell me how to do this?
Many thanks for your help and how to get this work as I hope.
Le mer. 1 juin 2022 à 11:55, Johannes Maron ***@***.***> a
écrit :
… Hi @pinpointconseil <https://github.com/pinpointconseil>,
Thank you for reaching out. I believe there seems to be a bit of confusion
about how this library is supposed to work. Which tells me, I have to do a
much better job explaining it in the docs.
There are a couple of things, that strike me as odd at first glance, and
I'd really appreciate if you could give me a little more information.
Understanding your line of thought will help me improve the documentation.
1. Why do your width and height fields have default values? What would
you expect those default values to do?
2. Why do you have None defined 3 times as an aspect ratio?
3. You didn't specify an aspect ratio in the template, was that
intentional?
4. You passed an explicit width and height in the template. What were
your thoughts behind this?
Again, thanks for reaching out. Good documentation is key and with your
help I believe we can make them much better.
Best
Joe
—
Reply to this email directly, view it on GitHub
<#24 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALPERPKWIC6DCQBF5GDRSADVM46SRANCNFSM5XMUOG4A>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hi @pinpointconseil, ah, I see. So, I believe it's worth reading a bit into the fundamentals of responsive images. I believe this is a great resource: This package is built to work with grid systems, and you don't need to define a width and height. You rather define an aspect ratio and how many columns your image is wide in your grid. EG, you if you want a 16/6 image this is 4 colums on {% picture obj.picture_field ratio="16/9" m=4 l=3 alt="picture of a dog" %} The library will calculate the proper media queries for you and make sure that you serve the perfect sized image on any device or screen size. This is a very different approach to how we used to handle images in the old days. There is not a single size. You need to serve the perfect resolution for 460dpi iPhones or 72dpi desktop screens. I hope this will help you a little. |
Beta Was this translation helpful? Give feedback.
-
I don't now if I'm doing wrong.
Here is the model settings:
In my template:
I uploaded the image, but image_picture_width and image_picture_height were overridden (800px, 600px)
In Chrome inspector got this:
why the image width are not set correctly? how to fix that?
Thank your to clarify as no information are available in the docs.
Beta Was this translation helpful? Give feedback.
All reactions