Live data from Hacker News

The algorithm for a perfectly balanced photo gallery

crispymtn.com

71–80 of 104 posts

Re: The algorithm for a perfectly balanced photo gallery

#71
post #66

This works well when the photos are not time sequential. I find it harder to follow the story when the photos are ordered by the partition fit instead of the time taken. It would be neat to optionally incorporate time into the algorithm.

We do not change the order of the photos, we just try to find a good set of breaking points inside that order.

Actually, Chromatic tries to read the EXIF "DateTimeOriginal" information to sort the photos and falls back to the "LastModifiedDate" if the former doesn't work.

Re: The algorithm for a perfectly balanced photo gallery

#72
post #51

Since I'm a CS theory person, I can offer some theoretical improvements on the running time and make the problem even more general... Instead of minimize the linear difference of partition, we might want to minimize the standard deviation, or basically any convex function, and still do it in the same time bound. One can reduce this problem to find a k-edge path of minimum weight on a complete DAG. The naive algorithm…

What is a complete DAG? Can I create one by just taking a complete graph, choosing an arbitrary ordering of the vertices, and assigning each edge a direction according to that ordering?

Edit: after reading the problem statement, yes, I can.

Re: The algorithm for a perfectly balanced photo gallery

#73
post #53

Side-topic. Shooting Holi [1] without putting your camera in an airtight sealed enclosure is a good way to ruin your equipment. http://en.wikipedia.org/wiki/Holi http://www.lensrentals.com/blog/2013/05/how-to-ruin-your-gea...

Given that that article says that the supposedly-sealed lenses were also vulnerable, do you have advice on how one would successfully enclose a lens to protect it from the dust?

Re: The algorithm for a perfectly balanced photo gallery

#74
post #35

WordPress recently added 'Tiled' galleries via their JetPack plugin. It seems like a similar approach. You can see an example gallery here: http://ma.tt/2013/07/jay-z-picasso/ Additional info: http://jetpack.me/support/tiled-galleries/ Code: https://github.com/crowdfavorite-mirrors/wp-jetpack/tree/mas...

This completely missed my radar back in May. Much appreciated.

Re: The algorithm for a perfectly balanced photo gallery

#75
post #13
post #8

Earlier quoted context omitted.

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

I substitute it with flickr's latest design overhaul.

BTW, thank you for the NSFW warning, as in a thread like this it's very tempting to blindly open galleries to compare layout. Very considerate of you.

Re: The algorithm for a perfectly balanced photo gallery

#76
post #60
post #59

Earlier quoted context omitted.

You must be fun at coloured powder throwing parties...

Ruining your camera isn't especially fun either.

Even just seeing the images of those lenses hurt a little. I'm glad for the heads up, really.

Re: The algorithm for a perfectly balanced photo gallery

#77

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 end up with some of the photos ending up behind other photos. Firefox 23 here.

Same for me in FF25 (Aurora), and Opera Next 16.

Re: The algorithm for a perfectly balanced photo gallery

#78
post #73
post #53

Side-topic. Shooting Holi [1] without putting your camera in an airtight sealed enclosure is a good way to ruin your equipment. http://en.wikipedia.org/wiki/Holi http://www.lensrentals.com/blog/2013/05/how-to-ruin-your-gea...

Given that that article says that the supposedly-sealed lenses were also vulnerable, do you have advice on how one would successfully enclose a lens to protect it from the dust?

There is waterproof casing (I mean for diving, not spray water), - I would hope that's enough? I don't know for sure though, so please don't take my word for it.

Re: The algorithm for a perfectly balanced photo gallery

#80
post #73
post #53

Side-topic. Shooting Holi [1] without putting your camera in an airtight sealed enclosure is a good way to ruin your equipment. http://en.wikipedia.org/wiki/Holi http://www.lensrentals.com/blog/2013/05/how-to-ruin-your-gea...

Given that that article says that the supposedly-sealed lenses were also vulnerable, do you have advice on how one would successfully enclose a lens to protect it from the dust?

There are underwater rigs for cameras that would no doubt work, although they depend on floatation to make it manoeuvrable.
Post reply on HN