Masonry with no image distortion

I get more and more about blocs and so I come up with my next big issue, which I cannot solve and cannot find any tutorials about. I want to create an image placeholder or/and finally a masonry gallery that might work like the images are buttons to open up either a lightbox/popup/modal. I have to different approaches like this here:

and here: alte-kapelle-bietigheim
scrolling down a bit to see this:

So far, always if I place an image inside a frame no matter masonry or normal and try to change the aspect ratio of the frame it also changes the aspect ratio of the image instead of placing the image to left right top or bottom and “cut” the image.

What am I missing here with placing images without distorting them
and
might be the “gridcontainer” (css grid) be my way to a solution?

Thanks in advance and Kind Regards,
Uwe

You can use

object-fit: cover;

It is not in the class editor of Blocs. But it does exist as a Bootstrap utility class. So you can add the following class.

.object-fit-cover

More information here:

With Iconic Gallery you can create galleries without image distortion and also masonry galleries. Please check in the demo, if this fits your requirements: https://iconic.blocsaddons.com/

2 Likes

Thanks the two of you Pete and Jannis

object-fit: cover;

may I ask, where to put it? That code? There must be something else for me to do because:


02-class

Do I have to have “fixed” something elsewhere?

I’ll put that in the wishlist. From my common sense It is absolutely necessary to have images just fill its imageboxes, isn’t it?
And - also to have a placeholder/box stay in the size, it is setup. It is not helpful for layout to have imageboxes completely change its size after placing images.
And of course it would be very cumbersome to setup images before for that kind of gallery.

The Iconic Gallery on the other hand is not a proper masonry - working on the website - in this case - a stonemason, and also for me as photographer and designer the masonry there looks not as a real world masonry is build - if you any played with lego, this is not how the stones - the wall - will keep its shape for a long time:

I like the fullscreenapproach though. Wondering if I can get the masonry to kind of fullscreen as well.

and also the start as well as the finishing images do not fit together.

Thanks and Kind Regards,
Uwe

There was a small error in the demo site, thanks for the heads up. Corrected now:

1 Like

As @PeteSharp said, try to add the Bootstrap utility class object-fit-cover

CleanShot 2024-08-28 at 13.48.13@2x

Now, as I do not fill in: object-fit: cover
but: .object-fit-cover

it works as expected.

Thanks, I was not aware to have to change spelling - I overread too quickly.

Next following question for masonry - looks fine now in the largest breakpoint, which I set to 2500 - to change and setup the next smaller breakpoint 991 - 769
and even smaller, it is always three columns and I cannot change height in between breakpoints. Is this true?



Thanks for the clearance of class and the spellchecking,

And Jannis, where can I look for your iconic gallery?

Kind Regards,
Uwe

1 Like

On this tutorial one can see very clear that Eldar is exactly missing what I am missing too. With putting in that class: object-fit-cover
It might solve exactly what I want to approach?

I check this out but if in advance there’s some advice on where or what to look at, I would appreciate that.

As one may see from my examples from : steinmetz-binder.de
I not only want some images but also some text in that grid.

I’ll come back to that mentioned wishlist as soon as I experienced some more but that “fill” or" cover" option would be great anyway, I guess. Adobe once had a “9-dot” button to “organize” where to put images if the frame is too small or didn’t fit the same aspect ratio while sparkle uses some buttons to place images either at the top - centered - bottom
or left - centered - right.

So, we will see - anyway thanks to all of you,

Kind Regards,
Uwe

One is the CSS, the other in a class that applies that CSS.

Utility Classes are classes already part of Bootstrap, which is the framework Blocs users.

Learning the utility classes can be useful. The style options in the class editor of blocs is not exhaustive.

You will find web design is different to graphic design. Often to build what you would like to, you need to learn some basics beyond just knowing how to use an app. Much like Photoshop really.

All the best.

1 Like

Yep, I try as hard as possible - and come back as often as necessary.
Thanks for responding here,

Kind Regards,
Uwe

1 Like

Everything has a learning curve.

Giving it a go, is the best way to learn, and half the battle.

1 Like

Well said Pete :+1: