Dynamic sorting and cropping of images is similar to viewing google + album

can someone help me find a solution to achieve the same result as google plus album view ?

The list of thumbnails allows you to maintain a consistent line width by re-sorting and cropping the images so that they fit all the time, and reinstalls them according to the size of the window.

I know about masonry , but it tends to create a lot of free space when the images do not have the same size ... (because it does not handle cropping)

Does anyone know of a plugin that does this? or if not the basic math behind him?

+6
source share
3 answers

Perhaps this is a little redundant for what you are looking for.

You can use the Simulated Annealing algorithm, which is usually used in electronics, to find the optimal layout for all tiny electronic components inside a microchip in a limited area, which is basically the same problem as finding the best layout for a set of images inside a browser window.

Basically, this algorithm gives you a good solution, but does not guarantee that it will be the best. Read the Wikipedia article carefully as it explains it better than me.

You can also check out this Simulated Annealing applet for a problem with the seller. Test the temperature of 500 and watch what happens when it freezes.

Hope this helps.

+1
source

What I found in google plus and maybe this can help you.

  • They cut some images to fit each other. You can easily find it in the first image.
  • They have lines of images with the same height.

So easy to do. You can adjust the images to the same height by scaling first, and on each line you can cut the widest part to adjust the line width.

O, by the way, if you pull the chrome window with google + service, it will not look as good as it was, some spaces will be displayed for some lines

0
source

Source: https://habr.com/ru/post/892380/


All Articles