Coder Social home page Coder Social logo

Comments (4)

iMerica avatar iMerica commented on August 27, 2024

Currently, if there are 7 images in the photo set and cols is set to 3, the component will display 3 images per row for the first two rows and one orphaned image on the last row using only 1/3rd of available space. See below.

grid-issues

It would be good to make cols only applicable to rows that have enough images to support it. Otherwise, use the entire space.

from react-photo-gallery.

neptunian avatar neptunian commented on August 27, 2024

@iMerica this is correct behavior. it solves the other issue you had brought up about the last image being stretched and distorted. it's very jarring to have the last image have a very tall row height because its perhaps a portrait sized image trying to stretch the width of the app.

from react-photo-gallery.

iMerica avatar iMerica commented on August 27, 2024

Ahh that make sense now - thanks for explaining the motivation behind that. In my application, its users who are the ones uploading images of varying quantities and aspect ratios and all the images combined need to fit into a perfect quadrilateral/rectangle (I forked this repo to achieve that.)

One idea to satisfy all of the above use cases would be to sort all image aspect ratios so that a portrait image is never the last image in a hanging row 💡 .

from react-photo-gallery.

neptunian avatar neptunian commented on August 27, 2024

@iMerica hopefully not all of your images are portrait! perhaps we can add an api option where there are no trailing images so the last image goes into the last row.

from react-photo-gallery.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.