Grow your CSS skills. Land your dream job.

Problem with Auto-Generating Photo Gallery

  • # October 12, 2009 at 8:35 pm

    I downloaded Chris’s Auto-Generating Photo Gallery and installed it on my server. I then uploaded photos and thumbs (taken with my Palm Centro. I quickly realized that my thumbs were named ***_t.jpg rather than ***-thumb.jpg I edited the php file in two places substituting _t.jpg. The collection of thumbs now appears but when I click on a thumb, I get an eternally rotating indication that it is trying to load the image but nothing happens. I uploaded the original files and sample images to another directory and it works without problems (at least in IE, not in Opera).

    Here is my gallery: http://lgrossman.com/pics/palm/ (This is the one that doesn’t work.)

    Here is the gallery with the unedited files http://lgrossman.com/pics/AGG/ (This is the one that works.)

    Any suggestions how I broke it or what is wrong will be appreciated.

    Thank you,

    Leonard

    # October 13, 2009 at 3:40 pm

    As far as I can see you have all of your thumbnails in http://lgrossman.com/pics/palm/images/ but not the full size images.

    # October 13, 2009 at 3:47 pm

    Exactly. My edit solved the thumb problem but somehow the full size images don’t appear.

    That’s the problem I am posting about.

    Len

    # October 13, 2009 at 4:44 pm

    You have to put the images in the same directory as the thumbnails.

    # October 13, 2009 at 5:09 pm

    D’oh!!
    That would explain it.

    Someone suggested I had too many images there. I thought I only deleted selected groups of images. I must have gotten carried away.

    Meanwhile, How about a version of Auto-Generating Photo Gallery that could extract or generate thumbs from the original images. That would be smooth.

    I am testing Single File PHP Gallery http://sye.dk/sfpg/
    See my test at http://lgrossman.com/pics/family/

    But AGPG is a much nicer presentation.

    Thanks for putting up with me on this one. Is there a place to put a kudo or resolved notification.

    Len
    http://lgrossman.com/albums/

    # October 13, 2009 at 5:30 pm

    Cool, we got there in the end. I probably should have been clearer with my first response.

    As for auto-generating thumbnails, I like http://devkick.com/lab/galleria/

    # October 13, 2009 at 9:03 pm

    Uploading the images really did solve the problem in IE but something is still broken in Opera.

    Someone on an Opera forum suggested:

    It’s actually a user bug, caused by not updating libraries. The issue
    was fixed in jQuery 1.3.0, released almost a year ago.

    >>> >>> Gory details:
    >>> >>>
    function(a){
    return this[0] == window ?
    E.browser.opera && document.body["client"+c]
    || E.browser.safari && window["inner"+c]
    || document.compatMode == "CSS1Compat" &&
    document.documentElement["client"+c]
    || document.body["client"+c]
    : this[0] == document ?
    Math.max(
    Math.max(document.body["scroll"+c],
    document.documentElement["scroll"+c]),
    Math.max(document.body["offset"+c],
    document.documentElement["offset"+c]))
    : a == undefined ?
    (this.length ? E.css(this[0], b) : null)
    : this.css(b, a.constructor == String ? a : a + "px")
    }

    The code grabs document.body.clientHeight in Opera. All the images are
    floats, so they don’t contribute to the body height. $(window).height()
    thus gives 113, less padding gives image height 13, adjusting for aspect
    ratio gives image width 16.

    Replace js/jquery-1.2.3.pack.js with an up to date version. Or just link
    to http://ajax.googleapis.com/ajax/libs/jq … ery.min.js and
    save the download.

    I am not sure If I should replace the old file with the new one, upload the new one as well, or upload the new one and rename it to the old name.

    Len

    # October 14, 2009 at 2:42 am

    Yeah you should always be using the latest stable version of jQuery. Replace the old with the new and alter the document head to suit.

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".