miromannino / Justified-Gallery

Javascript library to help creating high quality justified galleries of images. Used by thousands of websites as well as the photography community 500px.
http://miromannino.github.io/Justified-Gallery/
MIT License
1.69k stars 299 forks source link

Max-width of a tile? #134

Open Voyz opened 8 years ago

Voyz commented 8 years ago

Hi,

Is there a way to restrict a tile's width, just like it's possible to its height?

Setting max-width for the tile div results in cropped images and breaks the justification. image

Setting max-width for the img results in squashing the image, while the tile remains the same. image

Setting width for either gives no result.

Is there a way of setting max width of a tile?

Cheers V

ps. the gallery is great, massive thanks!

miromannino commented 8 years ago

You can restrict the width of the row, but of course restricting the single images is not possible, also because it need to crop them to do that. But tell me why you would need something like that, because I think there are other ways. Regards

Voyz commented 8 years ago

I use justified gallery to also work with texture files. These sometimes come unusually wide.

Eg.

shelf_bad

In this case that long tire-mark texture comes as the largest element and suddenly appears more important.

What I'd like to achieve is as follows:

shelf_bad_fixed

Where that red area is something I'd hope to create (And fill with some white or whatever)

Any way you can think of doing it?