Get a free trial // 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: (This is the one that doesn’t work.)

    Here is the gallery with the unedited files (This is the one that works.)

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

    Thank you,


    # October 13, 2009 at 3:40 pm

    As far as I can see you have all of your thumbnails in 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.


    # 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

    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
    See my test at

    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.


    # 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

    # 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:
    >>> >>>
    return this[0] == window ?
    E.browser.opera && document.body["client"+c]
    || E.browser.safari && window["inner"+c]
    || document.compatMode == "CSS1Compat" &&
    || document.body["client"+c]
    : this[0] == document ?
    : 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 … 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.


    # 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.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed