An Alternative Way Of Posting Images To Your WordPress Blog Using Symbolic Links To Zenphoto Images

WordPress has image management features which makes uploading and inserting images easy. When it comes to resizing and cache management, however, WordPress falls short. WordPress works like this: you configure your media sizes in the “Media” section of WordPress. Once this is done, every image you upload to WordPress is resized into these predefined sizes and saved in the same folder as the uploaded image.

The shortcoming? If you decide you want to change the media settings down the road, the new sizes won’t affect previously uploaded images. If you want the new sizes reflected on your old posts and galleries, you have to delete each old image, one by one, post by post, and upload the source image anew. Because caching and resizing is done during the upload of each source image.

This is where Zenphoto comes in. Cached images are stored seperately in a cache folder, and images aren’t “inserted” anywhere, they’re simply linked. Meaning: if you change media settings, linked images will request a new image with the new sizes.

I built the Zenphoto Short-tags plugin to try and take these superior image management features with me to WordPress. To use the plugin, you have to have Zenphoto deployed to your webserver and instead of uploading images to WordPress, you have to upload images to Zenphoto. Using short-tags you then insert highly customizable image links in WordPress. With recent features of the plugin (just yesterday, I added a WordPress Media button) you can now do all the management you want to, directly in WordPress.

Shorttags_02.png

Notice the new ZP Media button.

By the way, the above image was inserted using this code: [zp src=”Shorttags_01.png” crop=”tl” height=”300″]. The crop parameter ensures the image isn’t scaled, and cropped to the top left corner. It takes its width from a media setting in the backend. The album folder is normally a required parameter, but it’s not filled in because the image happens to be in the default folder.

Shorttags_03.png

Once clicked, the new media button shows your most recent images from your Zenphoto gallery. If you simply click one of these images, the shorttag for showing the image is inserted.

Shorttags_04.png

You can also click the “Upload image to ZenPhoto” tab to get an at the moment rather inelegant view of the Zenphoto backend, which lets you upload right then and there.

The bottomline is, Zenphoto Short-tags and Zenphoto offers you a different way of posting images to your WordPress blog. It requires a different way of thinking, and there aren’t any previews of your images in your visual editor. On the flipside, tweaking the width, height and crop of your images can be done by simply changing the parameters and without uploading anew. Worth a shot?

Zenphoto Shorttags For WordPress Plugin [Update: Semi-retired]

Few know it: Zenphoto is the best web gallery CMS there is. It is minimalistic, fast and stable. It powers this bloggers photostream, and its pictures grace these posts. Zenphoto is so great because the process of cropping, scaling and managing image cache is elegant, excellent, awesome.

This plugin allows you to take that scaling- and cache-management with you to WordPress.

That means, and read this carefully: you can insert what amounts to a symbolic link to an ultra-high-res Zenphoto image, specify width and the height as an attribute and have Zenphoto do the scale work for you. Even if you replace the source image, you can just purge the Zenphoto cache — all images linked using this plugin will have their scaled versions updated from the new source material. Chew on that one for a while: it’s paradigm changing. That’s what it is.

Not the plugin, mind you, Zenphoto is paradigm changing. This plugin is just an enabler, minimalistic middle-ware. Once installed, in your WordPress posts and pages, you can write:
[raw]

[zenphoto src="filename.jpg" width="600" album="album/subalbum"]

[/raw]
… and you’ll get a gorgous image of cows, provided you named the cow image “filename.jpg and placed it in an album called “subalbum which resides in the “album album:

[zenphoto src="pic156.jpg" width="600" album="photography/sweden"]

If you configure your default values correctly (you can provide defaults for widths and album), all you have to write is [raw][zenphoto src="filename.jpg"][/raw].

Future plans include adding parameters for watermarks, a feature thats already in the Zenphoto core. It is with regret that I’ve had to add an options page. The only thing it does, is take your information as to where you installed Zenphoto (it has to know, it’s the only integration it has). Other than that, I’ve made things real simple; if you forget parameters or forget to configure the path, the plugin will show error messages reminding you what to do.

One last thing: this plugin is different from other Zenphoto / WordPress plugins, in that it adds a link to the image object, not the cached image. That means you get the benefit of being able to change the size as many times as you want, as you author your posts, by simply changing the parameters. Don’t worry about the cache, by the way, Zenphoto magic makes sure that if the linked image object has already been rendered in your cache, the cache is shown.

Download

Download Zenphoto Shorttags

Parameters

Required parameters:

  • src
  • width

Optional parameters:

  • album
  • height
  • class
  • alt
  • link
  • crop (options: tl, tr, bl, br for topleft, topright, bottomleft and bottomright)

Available Short-tags

  • [raw][zenphoto src="filename.jpg"][/raw]
  • [raw]
    filename.jpg
    [/raw]

Crop

Crop is currently partially implemented. If you enter it as a parameter, crop="tl" crops the image so that it is unscaled, and top left aligned (hence tl). Also possible, tr, bl, br, for topright, bottomleft and bottom right. Works in conjuction with width and height parameters. The crop currently keeps the image unscaled.

Media Button

Since version 1.8, the plugin adds a media button for inserting images directly from your zenphoto gallery. It makes inserting the shorttag symlinks really easily. You can also upload from this interface.

Shorttags_02.png

Shorttags_03.png

Shorttags_04.png

[Update]: Zenphoto Shorttags is no longer actively developed. Instead, I’m working on Image Symlinks, which can take the place of this plugin. Please contact me if you wish to adopt this plugin, though.

Zenphoto Update Extraordinnaire

The team behind the now sweetest photo gallery offering has just released version 1.1. Zenphoto now offers EXIF file information, sub-albums, auto-watermarking, video embedding, tagging and searching.

I’m proud to say that I was once a tiny minuscule part in the development, as I designed what to my surprise is still the default Zenphoto theme. Read from the archives of Noscope for an indepth review of what I had to say about the design.

Zenphoto 1.1 is a delicious homerun for photography enthusiasts. I have it installed now; here’s my recommendations that you—the photo enthusiast reader—do the same.

Zen Photo Web Photo Album

Zen Photo

Zen Photo is a web application that allows you to create online photo albums. It supports automatic thumbnails and individual image comments. It has grown out of a desire to create simplicity among a myriad of complex alternatives.

I’ve been looking for just such an application for quite a while. Until just recently the landscape for web photo albums was bleak. Hence, I couldn’t refuse an invitation to design the default Zen Photo template, and the administration section.

Continue reading

Stream of Consciousness

It was William James who first introduced the concept of the stream of consciousness – a written equivalent of the thought process. It is not always possible to describe the reasons for a certain point of view, but one might be able to deduce it based specific opinions alone, but by getting all of the the myriad of different thoughts together.

In much the same way it will make more sense for me to write a sort of stream of consciousness, than it would be to write any other individual entry on what’s been happening these last few weeks.

The atrocities committed in London just recently rocked my world again. Much the same way those in Madrid did, and like those in New York, and those I hear about every day, every where across the world. The world is not as safe as it was ten years ago.

This project at work needs to finish soon. It’s been keeping people crunching 12 hour days for a month now. I’m not sure how long people can go on like that. As Sun Tzu said, there is no instance of a country having benefited from prolonged warfare.

On the topic of warfare, Bush visited Denmark on his birthday. I went to the anti-Bush concert and later that evening followed the circus on television. Seeing the size of the whole anti-terror machine that was put in to motion reminded me of when Clinton visited some 7 or 8 years ago. Indeed the world was very different back then.

Following Bush’s few speeches, I did get some insight into why people would vote for him. He wasn’t well-spoken, quite the opposite, but with a sort of southern charm. Apparently if you charm people enough, you can get away with lying to them and even send their children to war based on those lies.

I shouldn’t even be writing this. Bad things happened to Michael when he barely whispered a politically laden comment.

Reminds me of something I read in a paper a while back. The Internet has a democratic problem. Years ago, the Internet was predicted to be the new great catalyst of democracy, but according to the author, too few places allowed “open discussion”, which led the author to the conclusion of a lack of democracy. On one hand it’s not quite that simple, on the other hand—what can we do? How do political discussions work on the talk shows, and I’m not talking Fox News or Bill O’ShutUp’Reilly? Commonly, there’s a moderator, and people use their words. How does that scale to the Internet? Well, everybody needs to be moderators. It works for Wikipedia.

In the case of my little part of the Internet, I’ve been continually impressed by the high standard of comments seeping in. It proves to me that democracy can work on the Internet and that people aren’t all stupid. Seeing as how this side project of mine has grown very quickly over this last year, I wish I was able to stop the growth, press stop: this size and no more.

It’s also fun how pingbacks work. My colleague and friend Peter used one to respond to my rant about contracts, and why we should always have them. While I wrote that entry with sarcasm in my blood and irony in it’s simplicity, he’s right—as always. In the end, client/consultant relationships are like real life relationships such as marriage. It needs mutual respect and lots of communication. Oh, and the partners involved need to be compatible. I wish speed-dating was available for client relationships.

On blogging itself, I’m satisfied that I’m able to press pause and blog less. There are important things in life, and less important things. Joshuaink decided this as well. My best wishes to him and his.

Tristan has been hard at work on Zen Photo. So have Markku been on iPAP, and so have the talented people working on Plogger. It’s ironic really; not 3 months ago, there was not a single viable solution available for people who wanted a photo gallery on their website. Now there are 3 fantastic ones. To all three projects, I hope they understand just how much people will appreciate their work.

I noticed in my daily reads a while back, that bicycling in Copenhagen is seriously dangerous to your health. I’ve always known that the exhaust fumes weren’t healthy, but that cycling should be worse to your health than driving to work in a car came as a shock to me. Turns out it’s small particles from the exhaust of huge diesel powered trucks lacking certain filters. Honestly, such trucks should be taxed to hell and beyond. When something as simple as bicycling to work becomes dangerous to your health, the source of the problem should take a punch. Tax them so highly that driving a huge circle around the city is the only viable alternative. Bleed them dry until they filter their vents. Prune them into submission.

The weather is great outside. For most of the time I can remember, Denmark has been divided into winter and July, but it’s still nice. Yesterday the temperature was almost unbearable considering I was stuck at work. It really is about time I get started on my vacation. Just thinking about that White Russian I’ve got waiting for me in that house in Sweden makes me itchy. It’s there, just beyond my reach. Hopefully things’ll be better this Friday—hopefully I will start my vacation there.

According to Jakob Nielsen, it is unlikely that you’ve read this far. Fortunately it doesn’t matter. This one wasn’t really meant for you.

Description of the Perfect Photo Gallery

Photo Gallery

Not long ago, I called out for help in finding the ultimate online photo gallery solution.

I was not the only one who had looked for solutions. As my peers, my research didn’t result in immediate tangible solutions. This was actually a surprise, considering I had looked through more than 30 solutions.

On the upside, solutions are now on the visible horizon. Amid the cruft of CMS‘s, two systems emerged that both hold much promise. Additionally, the future looks bright with the outlook of a third system written from the bottom up with simplicity in mind.

The systems that are currently showing the most promise are:

In the hopes that these systems will blossom, I offer some advice as to what exactly it is I would want in a photo gallery CMS.

Core Values

There are solutions. This whole research and callout is based on the fact that I won’t touch any of those solutions with a pitch fork. Why? Because I have better things to spend weeks on. After all, we’re talking photo galleries, not rocket science.

Core values for the perfect CMS would be these:

  1. Simplicity in Structure.
  2. If in doubt, leave it out. That goes for features, graphics, tables, samples, themes, buttons, checkboxes, funny messages, cruft.

  3. Simplicity in Interface.
  4. Fewer features are better than more features. Period.

  5. Simplicity in Concept.

All we want is a photo gallery. It shouldn’t do anything else than this. If it’s not directly related to photography, then don’t even think it.

Minimum Features

I already have Photostack. Photostack is good, in fact it’s great. The only reason I’ve spent days on researching alternatives is because I need just one extra feature: the ability to comment on the photos. As such, this minimal feature list will very much mirror what Photostack already does.

  • A folder containing JPEGs is a Photo album.
    Plain and simple. Folder titles could be given using a .txt file like Photostack does.
    Upload JPEGs + push a button = Online album
  • Each picture allows people to comment.
  • Such a comment contains name, URL and comment.

  • Allows descriptions on each photo.

These descriptions could be added in the admin section.

Things to Avoid

Having researched the before-mentioned 30+ photo gallery CMS‘s, I know what should definitely be avoided.

  • Require PHP Safe Mode off
  • The bulk of the most promising systems required the webserver to have PHP Safe Mode to be off. Safe Mode is there for a reason—requiring it off cuts away users. I’d rather write in foldernames in a textfile than have Safe Mode off. A good CMS will work even in PHP Safe Mode.

  • Flat-style photo storage
  • Most of the really promising systems I ultimately had to scrap due to their way of storing photos. I don’t want to have all my photos stored in one large folder, even if they are automatically renamed and sorted in the SQL. I want a simple, logical structure like on my own computer. Folder = album.

  • Multi-purpose CMS systems

Keep it at the photo gallery level. Don’t bloat it with things that it only does half-heartedly. Photo gallery != blog || forum || photo-sharing-system.

Things to Do

Pick out the good features, add them. These are things that would be nice:

  • PHP & text files or PHP & SQL
  • Cruft free URLs (albumname/imagename is preferred over ?album=3&image=5)
  • mod_rewrite is your friend, and it’s easier to use than you might think. Go that extra length and beautify URLs. A side-benefit: Google will reward you, and hackers won’t know whether you’re using ASP or PHP.

  • Basic spam protection
  • When commenting is involved, spam is involved. As a basic measure, obfuscate commenting forms.

  • Admin description system
  • Being able to describe each image with a thumbnail above is worth spending time building.

  • RSS
  • Adding an XML feed shouldn’t be too hard, but many would appreciate it.

  • Really simple templating system that’s “not-too-specific”

I would very much like to make a simple PHP include in the template.

Conclusion

I wish I was able to program a system such as this. I would be able to do more than just talk. Being in the situation that I am in, however, all I can do is advise what I would love to see. Now run with it, and go make the ultimate photo CMS. Keep in mind that Hotscripts.com lists 371 photo gallery CMS‘s—this might indicate that there’s a definite need for a system that just works.