I've just written this plugin today, if anyone if interested, please try it out and let me know if there are any bugs. You can download it here.
Basically what Picture Frame does is replace <img src="http://a.com/b.jpg" /> in posts with a framed and linked version of the picture. Frames are absolutely customizable and there is a sample in "wp-content/pictureframe/pictureFrame.gif" in the ZIP file. You can see a sample page here.
Frames work by taking a chunk of the original image and putting it "in" the frame. How it works will be clear once you start playing around with it. What Picture Frame does not do is re-size the image. If you need more explanation into how images are used let me know.
- Extract plugin files to a temporary directory.
- Open "wp-content/plugins/pictureframe.php".
- Scroll down to the part with "-- Settings".
- Change "http://www.paulchiu.net/" to the address of your blog. You will need to end the address with a "/".
- Other settings explained:
- "plugin_dir" ; Plugin directory for your blog, relative to your blog's address.
- "frame_file" ; Frame file location, relative to your blog's address.
- "frame_transparency" ; The color to be considered transparent in your frame file, replace "255, 0, 255" (pink) with the RGB value desired.
- "option" ; Default display option to use when one is not specified. Option values are explained in the usage section.
- Upload Picture Frame files to your blog.
- Activate the plugin in your WordPress admin.
- Change linked images' style in your theme's style.css file.
One limitation of the plugin is that images must be referenced absolutely. E.g. "http://www.paulchiu.net/images/x.jpg" and not "images/x.jpg". The following are some samples accepted image declarations:
<img src="http://www.a.net/images/x.JPG" alt="Pic 1" />
<img src="http://www.a.net/images/y.JPG" alt="Pic 2" option="topleft" />
<img src="http://www.a.net/images/z.JPG" alt="Pic 3" option="bottomright" />
The "option" attribute is a combination of either "top", "middle", "bottom" and "left", "center", "right" combined. The default option is "middlecenter". Option will decide which section of the image to place into the picture frame if the image is larger than the frame. If an image is smaller than the frame, it will be centered in the frame. When including images smaller than the frame in posts you will notice another limitation of the plugin, and that is the background color of the frame that is not filled by the specified image will be black. Unfortunately that black cannot be changed yet (I still need to figure out how).
That's it, hope my explanations are reasonably easy to understand and that you'll find the plugin useful.