My Picasa -> WordPress tool

Picasa is a great little program. It has some faults, but it’s free, so complaining would be silly. One nice feature is that you can generate HTML photo galleries. Then you just upload the output, and your photos are on-line. That’s fine, but I wanted to have these galleries inside my blog, and use a nice viewer like Lightbox instead of the boring HTML that Picasa produces. Here’s an example of the Picasa HTML.

gallery-in-a-blog

So I wrote a C# tool that takes the Picasa HTML and converts it to HTML that you can drop into a WordPress entry. Here’s the same gallery as above, but in a WordPress entry. The tool even grabs the captions from Picasa and uses them as the “alt” and “title” tags in the resulting HTML, so Lightbox displays the caption under the image.

Right now the tool is a bit inflexible, and it’s a command-line tool, but with a bit more time I hope to add a user interface and support different configurations. In the meanwhile, don’t hesitate to ask if you’re interested.

Wrapping text around images

collage

Its embarrassing, but I’ve been blogging for a while, and just noticed that WordPress can do this. It’s not very flexible though, and it’s best if the paragraph is long enough to span the height of the image.

I’m not happy with the default padding around the image. The only reason this one looks ok is because the image itself has a fairly wide black border. Surely there’s a way to fix that…

UPDATE: Aha! As you can see, the text wraps around the image above.

As usual, the answer isn’t as simple as it might seem. The problem was first that the older style formatting was being used (ie: align=”left”), whereas the new-and-improved method is to use CSS-style markup (class=”alignleft”).

However, that only works if the theme you’re using defines what alignleft means in the context of images. If you try it and it doesn’t work, then you’ll have to look at the style.css file in your theme. It should have a section that says img.alignleft. Not all of them do though. In fact this theme does not. It does however define img.left, so using class=”left” fixes the problem. 

If your theme doesn’t have any support for wrapping text around images, you’ll have to add something like this to your style.css file:

img.alignleft {

 padding: 4px;

 margin: 0 7px 2px 0;

 display: inline;

 }

It’s the display inline; line that causes the actual wrapping to work.

All dressed up, and…free!

It’s really easy to take free stuff for granted. It’s easy to assume that, because it was easy to get, it was easy to create, which couldn’t be further from the truth.

So, I want to point out that the people that create and maintain WordPress have put a lot of work into it, and it’s a really nifty blogging system. But one of the things that really gives a blog flavor is the theme, and it’s amazing how many themes people make available for free. The theme I’m using for this blog is called Yellow Jacket, and it’s one of several that Anthony Baggett has created. I’ve made a few tweaks, but I think this is a fantastic looking theme.

Let the testing begin…

Alright. I’ve got a few projects in mind, and this stuff is too nerdy for my main blog, so I’ve set this one up to document and experiment. So it may not always look so great.

For one thing, I’ve been wanting to do a full-blown image gallery in ASP.NET with SQL in the background for some time now, partly because I think they are interesting technologies, and partly because I have to do SOMETHING to keep up with my exploding photo collection. As it is, if I take a new picture that I like, and decide it would go nicely in an existing collection that I have on-line, I have to re-generate all the HTML and upload the modified files. It would be SO much better to just upload the picture, add a keyword, and have it automatically start showing any collections that use that keyword.

More recently it occured to me that, since I’m using WordPress heavily anyway, that I should just invest the time necessary to learn enough PHP to implement a gallery within a blog. That’s one thing I’d like to try with his blog.

But only time will tell. After all, my closets, notebooks, and hard-drives are full of projects that started with passion and then quietly died…