Live data from Hacker News

The algorithm for a perfectly balanced photo gallery

crispymtn.com

11–20 of 104 posts

Re: The algorithm for a perfectly balanced photo gallery

#12

What's just as impressive is the full size view of the image. The background brings the ambient colour of the photo to make it more immersive. Very nice!

Nice catch ... it so subtle i didn't notice but none the less a very nice feature. Love the execution of their idea!

Re: The algorithm for a perfectly balanced photo gallery

#13
post #8
post #7

Maybe I'm missing the point but why is this an achievement? I've seen Google images do this for years (from the backend, sends the users viewport dimensions and then automatically calculates the optimum filling). For years (Warning NSFW!) vusker.com has been doing this client-side in their thumbnail and gallery view. Plus look at the vertically stacked posts from Pinterest. It seems more a marketing ploy to get atten…

Granted, maybe pinterest is a bad example in regards to optimum page filling.

I substitute it with flickr's latest design overhaul.

Re: The algorithm for a perfectly balanced photo gallery

#16

I just implemented pretty much the same thing from scratch for my wedding gallery¹. For each row, it tries 3-10 images, sums their aspect ratios, divides the total row width by the sum to get a candidate height, then picks the height that's closest to the average of the existing rows. To make things look a bit nicer, it rejects candidate rows with the same number of images as the last row. I might release the code on…

I'm not seeing any images on Chromium. Just a blank white screen with "Matt & Sophie's wedding photos" at the top.

Congrats on the wedding though.

Re: The algorithm for a perfectly balanced photo gallery

#19
"Remember the days in college when you learned all about the big Oh!'s and re-implemented all these sort-algorithms for the hundredth time? If you are a web developer like me, chances are you never had to touch a single one of these algorithms ever again." +1

It's a good start, but when the window is shrunk, the result isn't as impressive.

Re: The algorithm for a perfectly balanced photo gallery

#20
post #16

I just implemented pretty much the same thing from scratch for my wedding gallery¹. For each row, it tries 3-10 images, sums their aspect ratios, divides the total row width by the sum to get a candidate height, then picks the height that's closest to the average of the existing rows. To make things look a bit nicer, it rejects candidate rows with the same number of images as the last row. I might release the code on…

I'm not seeing any images on Chromium. Just a blank white screen with "Matt & Sophie's wedding photos" at the top. Congrats on the wedding though.

Maybe Chromium is blocking the redirection to cloudfront, where the images are hosted? I had to tell Firefox's RequestPolicy, to let these requests pass...
Post reply on HN