Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor gjanes

    (@gjanes)

    The problem is the fact that the phototile display must round when scaling to the dimensions that you request.

    For example, the actual dimensions where the phototile will display without rounding would be 1000 pixels in width. Even divisors of that also work *fairly* well, but again when it has to scale to your width, then scale all photos to match, a photo must be requested in even pixel amounts, but the scaling usually ends up with decimals.

    The plugin does the best to figure out the best way to round either up or down to make things add up correctly, but unfortunately it never quite works perfectly.

    If someone wants to look at the code and offer suggestions for better ways to handle rounding and image dimensioning, I’d be happy to implement it. But the logic got really tricky and I got tired of fighting with it and got it to a “close enough” state and let it go.

    Thread Starter markusk

    (@markusk)

    what i suspected. probably cropping is the only way to get around this..

    so you did write this yourself? this isn’t a thirdparty-lib? isn’t there any?..

    Plugin Contributor gjanes

    (@gjanes)

    I wrote the phototile layout myself. There wasn’t any 3rd party library that seemed to accomplish what I wanted it to do in replicating what Google+ does.

    The photos are actually being cropped in the phototile layout, but the problem is determining the exact width (minus the borders) to make each photo, especially when in a series of 4 photos in a multi-row layout, 4 of the same width don’t add up to the target width, so the photos need to differ in width, some rounding up and some rounding down.

    I’m sure that there would be a better way to handle the dimension setting, but I had spent enough time on the functionality that I didn’t want to commit any further time – it was “good enough”.

    I would gladly accept suggestions for improvement from anyone who wants to pour through the code, make changes, test them and then provide me with the modifications to make.

    Thread Starter markusk

    (@markusk)

    seen this?
    https://github.com/moeishaa/jglance
    http://moewashere.com/jglance/
    (hurray for badly SEOed pages..)

    Thread Starter markusk

    (@markusk)

    though.. no.. that has same height lines all the time.. and most others either.. nevermind.

    Plugin Contributor gjanes

    (@gjanes)

    Yeah, I looked at several phototile layout projects, but nothing really seemed to imitate Google+ very well.

    I also looked at several of the box packing problem algorithms and libraries available, but again nothing really fit what I wanted to do in matching what Google+ does.

    So, I finally wrote my own. And the mechanism is simple enough, except for the scaling and rounding issue, which I tried several iterations of changes to perfect and never could quite get it perfect.

    I would love for someone with some extra time to review my code and provide suggested enhancements, but I’ve already probably allocated too many hours to it myself.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘phototile imperfections’ is closed to new replies.