February 24, 2008 – 2:34 pm
Lorem ipsum…
 |
|
20080209-IMG_0819
|
|
100mm at f/2.8 for 1/1000s (ISO 200)
|
| Taken:
2008-02-09 15:21:47
| Camera:
Canon: Canon EOS DIGITAL REBEL XTi
|
|
See Enclosing Album || Other Sizes: Med | Lrg | XL | XXL | XXXL | Orig
|
So I’ve been working on a plugin for WordPress that’ll let me embed images from my SmugMug account in blog posts.
The image you see above is served up from SmugMug servers, and I embedded it in my post with one simple tag:
[ smugimg id="imageid" key="imagekey"]
Of course, now you’re asking, “Just how do I figure out the image id and the image key???” Well, you could right-click on an image when viewing it at SmugMug and click “Properties” - the image’s filename format is
imageID_imageKey-size.jpg
But that sucks, so now I’m working on a page (testable here: test.php) that’ll show you all your galleries and images and generate the little smugimg tag that you need. Of course, ideally, such a page would be integrated with WordPress’s post editor page somehow. I don’t know if that’s possible, but I am planning to check into it…
Since I use file-based-posts, and don’t use the WordPress editor to create posts and save them into the database, this WordPress plugin is a filter. This means that it runs every time that the post is displayed, and looks for my smugimg tag. This isn’t exactly highly efficient, but that’s the way it is for now. Once it’s done, it’ll be a cakewalk to make a version that acts as a plugin which runs when you save a post to the WordPress database and generates the code then.
I’ll probably add this lightbox for WordPress dealie, as well as optional links to the image in SmugMug and/or the album in SmugMug where the image resides…
Big thanks to Colin Seymour, without his phpSmug library I would have had to write my own; and since I’ve been working exclusively with Java for the last 10 years, and haven’t even looked at a line of php code since 1999, that would’ve sucked. Oh well, since I’m on the topic: php is still crap.
Thanks also to Jesse Foster. I didn’t use any of his code, but did appropriate his SmugMug API key for the time being, since SmugMug isn’t issuing them at present.
Posted in Photography, Software | 1 Comment »