Movable Type Plugin: Curvaceous

| | Comments (2) | TrackBacks (0)
Categories:
Curvaceous is a plug-in for Movable Type 4 that causes text to flow smoothly around the edges of irregularly shaped images, as shown in the actual screenshot below:


curvaceous.pngOnce installed, the plug-in works in the background, converting any images that are either left-aligned or right-aligned.

Requirements

  • Movable Type 4
  • Image::Magick (you probably have it, but please consult your web hosting service)
Installation

  1. Download Curvaceous for Movable Type, and extract the archive file.
  2. Upload the contents of the archive to the "plugins" folder in your Movable Type installation. (There should now be a directory called "Curvaceous" in the plugins directory.)
  3. Go to Preferences -> Plugins for each of the blogs where you want to enable Curvaceous.
  4. Check the "Enable" box, and click "Save Changes." (You should seriously consider not selecting "all" as the build method.)
  5. For each template for which you plan to use Curvaceous, add the following line between the <head> and </head> tags (if you are using the MT4 default templates, go to the Template Modules and edit the "Header" template):

<$MTCurvaceous$>

  1. Edit the templates that display entries (in the MT4 default templates, those would be the "Entry Detail" and the "Entry Summary" template modules), adding the tag modifier curvaceous="1" to the <$MTEntryBody$> and <$MTEntryMore$> tags; for example:

<$MTEntryBody curvaceous="1"$>

  1. Add a link to the Curvaceous for Movable Type page on your own blog on all pages where Curvaceous converts your images. The software is free of charge, but you must add a link.
Usage

Enable Curvaceous in the plug-in settings, and then simply insert the images using the "insert image" button in your entry editor the way you're used to.

If you prefer to code in raw HTML, insert the images manually using the <img> tag and specify whether it should be left-aligned or right-aligned by entering "float: left;" or "float: right;" in the style attribute.

Please note that this plug-in may significantly increase build time for your blog. To minimize your build time, there are three options available for the build method: firstly, you may choose to convert all images via the Curvaceous plug-in. This will be the most time-consuming method. Secondly, you may choose to convert either just the images you specify, or all images but the ones you specify.

To specify an image for inclusion or exclusion (depending on your choice of build method), simply include the class type, "curvaceous" in the image's "class" attribute in the raw HTML. For example, if you insert an image and click the <A> button, add the word "curvaceous" as follows:

Known Issues

  1. PNG images must be in RGB mode; Image::Magick does not seem to recognize the transparency information in grayscale images.
  2. Animated images are not supported.
Note: to use Curvaceous for Movable Type, you must place a link to the Curvaceous for Movable Type page on your own blog on all pages where Curvaceous is used to modify the images. (For commercial use: you can avoid linking to the Curvaceous page by paying a registration fee--please contact me at wolf@blazingangles.com.)

To report bugs or request features, please use the comments.

  • Currently 4.3/5
  • 1
  • 2
  • 3
  • 4
  • 5
Rating: 4.3/5 (3 votes cast)

If you liked this post, share it with others:
  • Digg it!
  • Add to Del.Icio.Us
  • Add to Technorati
  • Stumble It!
  • NewsVine
  • Slashdot
  • Google Bookmarks
  • YahooMyWeb
  • Live
  • Facebook
  • Facebook
  • Add this post to Ma.gnolia
  • Add this post to Reddit
  • Thoof it

Categories

0 TrackBacks

Listed below are links to blogs that reference this entry: Movable Type Plugin: Curvaceous.

TrackBack URL for this entry: http://blog.blazingangles.net/MT/mt-tb.cgi/1373

2 Comments

Beau Smith Author Profile Page said:

Looks cool. Two questions:

  • what technique is employed to make this work?
  • can you place an example in this entry?

Cheers.

Ole Wolf Author Profile Page said:

Beau,

The technique is sometimes known as "sandbagging." It means that the image is displayed using several "div" segments stacked on top of each other. Each "div" displays only a portion of the image. In this case, each "div" has a fixed height but a width that depends on the first occurrence of a non-background pixel in the image. By floating these "div" segments left or right, the text will appear to flow smoothly around the image.

I prefer to keep the list of plug-in dependencies as short as possible, so Curvaceous isn't actually enabled for this blog. However, the HTML output that produced the screenshot above looks like this (cleaned up a little bit for readibility), with sandbag heights of 15 pixels:

<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><div class="contoursandbag"><div class="contoursandbag-left contoursandbag-first" style="background: url(http://my.doma.in/flowers-curvaceous.jpg) -0px -0px no-repeat; width: 144px; height: 15px; margin: 0 20px 0 0; "></div>
<div class="contoursandbag-left" style="background: url(http://my.doma.in/flowers-curvaceous.jpg) -0px -15px no-repeat; width: 152px; height: 15px; margin: 0 20px 0 0; "></div>
<div class="contoursandbag-left" style="background: url(http://my.doma.in/flowers-curvaceous.jpg) -0px -30px no-repeat; width: 177px; height: 15px; margin: 0 20px 0 0; "></div>
<div class="contoursandbag-left" style="background: url(http://my.doma.in/flowers-curvaceous.jpg) -0px -45px no-repeat; width: 227px; height: 15px; margin: 0 20px 0 0; "></div>
<div class="contoursandbag-left" style="background: url(http://my.doma.in/flowers-curvaceous.jpg) -0px -60px no-repeat; width: 228px; height: 15px; margin: 0 20px 0 0; "></div>
<div class="contoursandbag-left" style="background: url(http://my.doma.in/flowers-curvaceous.jpg) -0px -75px no-repeat; width: 231px; height: 15px; margin: 0 20px 0 0; "></div>
<div class="contoursandbag-left" style="background: url(http://my.doma.in/flowers-curvaceous.jpg) -0px -90px no-repeat; width: 230px; height: 15px; margin: 0 20px 0 0; "></div>
<div class="contoursandbag-left" style="background: url(http://my.doma.in/flowers-curvaceous.jpg) -0px -105px no-repeat; width: 207px; height: 15px; margin: 0 20px 0 0; "></div>
<div class="contoursandbag-left" style="background: url(http://my.doma.in/flowers-curvaceous.jpg) -0px -120px no-repeat; width: 253px; height: 15px; margin: 0 20px 0 0; "></div>
<div class="contoursandbag-left" style="background: url(http://my.doma.in/flowers-curvaceous.jpg) -0px -135px no-repeat; width: 256px; height: 15px; margin: 0 20px 0 0; "></div>
<div class="contoursandbag-left" style="background: url(http://my.doma.in/flowers-curvaceous.jpg) -0px -150px no-repeat; width: 269px; height: 15px; margin: 0 20px 0 0; "></div>
<div class="contoursandbag-left" style="background: url(http://my.doma.in/flowers-curvaceous.jpg) -0px -165px no-repeat; width: 270px; height: 15px; margin: 0 20px 0 0; "></div>
<div class="contoursandbag-left" style="background: url(http://my.doma.in/flowers-curvaceous.jpg) -0px -180px no-repeat; width: 249px; height: 15px; margin: 0 20px 0 0; "></div>
<div class="contoursandbag-left" style="background: url(http://my.doma.in/flowers-curvaceous.jpg) -0px -195px no-repeat; width: 154px; height: 15px; margin: 0 20px 0 0; "></div>
<div class="contoursandbag-left" style="background: url(http://my.doma.in/flowers-curvaceous.jpg) -0px -210px no-repeat; width: 164px; height: 15px; margin: 0 20px 0 0; "></div>
<div class="contoursandbag-left" style="background: url(http://my.doma.in/flowers-curvaceous.jpg) -0px -225px no-repeat; width: 164px; height: 15px; margin: 0 20px 0 0; "></div>
<div class="contoursandbag-left contoursandbag-last" style="background: url(http://my.doma.in/flowers-curvaceous.jpg) -0px -240px no-repeat; width: 159px; height: 7px; margin: 0 20px 0 0; "></div>
</div></span> Lorem ipsum dolor sit amet...

There's also a very short section in the style sheets. As can be deduced from the above HTML code section, a typical image displayed using "Curvaceous" will increase the HTML page with a few Kbytes. Each section refers to the same image, however, so the download time is only increased by these few KBytes.

The output can be fine-tuned, of course. For example, two consecutive sandbags of almost equal width could be combined into one. Further, the sandbags wouldn't necessarily need to be forced to have equal height. But, those are (planned) future improvements.

Leave a comment

Sign In

About This Entry

This page contains a single entry by Ole Wolf published on June 5, 2008 7:30 AM.

Previous entry: Movable Type Plugin: Joomsayer Updated for MT 4.1.

Next entry: Movable Type Plugin: Sociotags Updated to v. 0.3.

Find recent content on the main index or look in the archives to find all content.

Subscribe to Comments

Creative Commons License
This weblog is licensed under a Creative Commons License.