Pictures

You’ll find the pictures at the top of the page now change quite a bit and are linked back to the photo album. If you use WordPress (for blogging) and Picasa (for photos), it is pretty easy to set up. There are several Picasa plugins for WordPress. I’m using PicasaWeb. Here’s the code snippet I used to add it to my template:

<div id=”toppictures”>
<? picasaWeb(array(“username”=>”jaytricia”, “showRandomAlbum”=>true, “random”=>true, “num”=>5, “size”=>160));?>
</div>

That “toppictures” id has some critical attributes when applied to images. Here’s how it is defined in the stylesheet:

#toppictures img {
padding: 0;
border: 0;
margin: 0;
height:150px;
width:150px;
overflow:hidden;
}

Picasa can only feed thumbnails of a certain size, and the landscape versus portraits don’t align well. On top of that, I need the images to be exactly 150 pixels wide (times 5 images equals the 750 pixels of width I have to work with). So I start with the 160 pixel size image via PicasaWeb and then max the height and width to 150 pixels. That “overflow” attribute is critical. It says, “hide any part of the picture that exceeds the height and width”.

So with those few lines I have a random assortment of pictures, some portrait, some landscape, all cropped to 150 pixels by 150 pixels on the fly.

15 Comments

  1. Mark
    Feb 27, 2007

    But how did you get code to show up as text?

  2. Jay
    Feb 27, 2007

    Using ASCII codes instead of the characters. Like this:
    &lt;div id=”toppictures”&gt;

    WordPress does the conversion for you if you use the visual editor. You can find them here (and elsewhere):
    http://www.ascii.cl/htmlcodes.htm

  3. Uncle Andrew
    Feb 28, 2007

    Jay, it looks like the code randomly assigns one album to the page, and then only picks photos from that particular album. On refresh it may be a different album, but again all the pics are from that same source. Is there a way to re-work it so that photos from multiple albums can appear at the same time, or was that not something you wanted to do?

    Not complaining, just noticed that you may have the same type of picture on there (example: family all sitting on the same couch) a few times, which would occur a lot less frequently if you were pulling from different albums on every refresh.

    My biggest concern is, of course, that people realize Peck has more than that one green shirt.

  4. Jay
    Feb 28, 2007

    Initially, it picked a random album and then displayed the first 5 pictures from that album. So you got the same pictures, in the same order, over and over.

    Now, you get a random album with a random selection of pictures from within that album. That’s the limitations of the plugin.

    I’ve updated the main entry to reflect the modified code.

    However, I’ve started to dig into the code a bit to see if it can be tweaked to pick random pictures that span albums. We shall see.

  5. Jay
    Feb 28, 2007

    Of course, even if I manage to fix up the code, that won’t change the fact that Mark only brought one shirt when our families went on vacation together…

  6. Adrian Gallagher
    Feb 28, 2007

    The first time I looked at your new page Jay (from Firefox) it had four photos across the top (with white space in between) and the fifth under it. A reload fixed it (or made it display as expected) and it always displayed OK in IE.

    One more thing where God knows the reason why but probably no man ever will. So many things to ask Him when I get there.

    …adg

  7. Jay
    Feb 28, 2007

    Adrian! It’s good to hear from you. I’ve missed hearing your perspective since I closed the forums.

  8. Mom/Ruth
    Mar 1, 2007

    What a wonderful trip down memory lane!

    Hi, Adrian — I too had a similar display for a few days, then I used reload to see what pictures would come up and the problem was fixed. I was thrilled since I rarely “fix” things on the computer by myself (just ask my husband).

  9. Peter Brunone
    Mar 1, 2007

    Who would have thought that a reload could do so much?

    Thanks for the photo-smattering.

  10. Adrian Gallagher
    Mar 1, 2007

    I’m not in heaven yet Jay.

    When you closed your forum I went to a couple of others and had some unpleasant experiences. The members of yours were so well mannered. I described the members of one forum I went to to a pastor’s wife as being “ratbags” (see http://www.m-w.com/cgi-bin/dictionary?sourceid=Mozilla-search&va=ratbag if you don’t speak Australian). Some folk got so nasty if you disagreed with them. No wonder the Church is so weak. Anyway that forum initally deleted most of the posts then closed down. It’s sad.

    So I’m not contributing to any forums at the moment which is a lot less stressful. But we have the grandkids with us while there new house is being built which is good (see http://caleb-rimell.blogspot.com and http://laura-rimell.blogspot.com if you like baby pictures) so I put the time into them.

    May 2008 I intend to go to South Africa, Nigeria and Rwanda (http://www2.hillsong.com/church/default.asp?pid=175) with a team from the church. That will be interesting.

    Adrian

  11. Nils
    Mar 5, 2007

    I’m a Picasa user, too. Love it.

  12. Mom/Ruth
    Mar 13, 2007

    Are you through playing, yet? Just kidding! The end result is even better than before.

  13. Jay
    Mar 13, 2007

    Unfortunately, right after I got the pictures set up, Picasa changed the format of its RSS feed, thereby breaking the picasaWeb wordpress plugin I had installed. I’ve been working with the author of the plugin, and he’s fixed it up.

  14. CuzNuz Ruth
    Mar 13, 2007

    I do like seeing these old pictures of your family. What a neat idea.

  15. Jay
    Mar 14, 2007

    Well. Bill (author of the picasaWeb plugin — http://rawlinson.us/blog/articles/picasaweb-wordpress-plugin/) has been very helpful, but Google really changed around the format of the rss feeds. So I’ve temporarily hacked the code so that it will work for our picasa account while Bill sorts out a more elegant solution.

    We therefore, once again, have a random album selected each time with some random photos from that album displayed.