WordPress Image Quirk

While posting my last entry, I discovered a problem with WordPress’s new editor and the way it inserts images into a post. The new version of the post editor is quite slick and includes handy dialogs for inserting media (tiny buttons above the editor window). Here’s the problem:

A Duck

A Duck

If I insert a paragraph break after the image and before the text, the text doesn’t wrap around the image. This seems reasonable enough (though hard to follow because there are no <p> or <br> tags to see where breaks are going. The visual editor displays the image inline, but the actual post does not.

A Duck

A Duck

If I use the html editor and type text right after the image tags, as if they were all part of the same paragraph, I get the image inline as expected.

You would think that it is simple enough to make each image part of a paragraph of text, but, if the paragraph is too short, you end up with a gap before the start of the new (non-flowing) paragraph (as with this paragraph).

A Duck

A Duck

The solution seems to be to add explicit <br></br><br></br> tags (two sets) and running the two paragraphs together, instead of pressing enter in the editor.



Then the next paragraph displays correctly flowing around the image (like this one).



Something here is broken, and I think it is the editor module in WordPress. Because it doesn’t show the <br> or <p> tags, even in the html view, the user can’t predict the results very well. I noticed a similar problem when I tried to add a break inside a <li> tag in another post.




A DuckAs you can see above (in Firefox, but not in IE), the caption function causes the flowing paragraph to take on the attributes of the caption, so it seems best to avoid using the caption function (as here) in order to keep your text consistent within the post.



I’ve experimented with different tags and settings in style.css and tried inserting image tags without using the editor’s “Add an image” function, so I’m reasonably confident that problem lies in the editor. I’ve also noticed that if you do put in your own <br> or <p> tags, and then switch to editing with the visual editor, they are stripped out of the saved version and you end up back where you started.

Annoying!

Auditioning Multimedia Distros (part 1 – dyne:bolic)

Cinelerra is a full-featured non-linear video editor for Linux. It has capabilities which, while nowhere near as polished, are roughly comparable to Final Cut Pro, the only commercial NLVE I am familiar with.

I’ve had a lot of trouble with Cinelerra over the years. I managed to successfully create a 40 minute rough cut of my latest project over a year ago, but then, due to upgrades on my Debian box, I couldn’t do any further edits. Cinelerra would hang or crash at times. Other times, I could load my project, but I couldn’t playback anything or make edits. In short it was an unusable pain and I nearly gave up.

Fortunately, I had faith that it was indeed possible to use Cinelerra successfully (in fact, I think it is a very good NLE tool which I enjoy using). Now that I’ve finally decided to tackle setting it up again, I decided rather than invest a lot of time messing with my existing Debian install (which refused to let me install Cinelerra and Kino at the same time due to library conflicts), I decided to start fresh with a setup intended for multimedia production.

I started with d y n e : b o l i c version 2.5.2.  I loved the XFCE desktop and the piles of cool multimedia software.  Dyne:bolic (made by Rastafarians! — I think that should be the distro’s motto) also allows you to copy the live CD to your hard drive without dual booting or disrupting your regular OS.  Cool.

Unfortunately, the live CD doesn’t include apt for upgrades (apt is a package manager in Debian-based distros which allows simple, one-command upgrades of all installed applications and easy installs of new packages from on-line repositories), so it isn’t really easy to fix problems with the pre-installed apps.  I was happy to use dyne:bolic anyhow until I discovered that Cinelerra simply doesn’t work in this version of the distro (at least on my crappy old hardware).

dynebolic screenshot

dynebolic screenshot

Due to a configuration problem with the kernel (or something? see Cinerella dont work :-(: msg#00020)) Cinelerra will load, but won’t allow the user to interact with the menus or controls.  This was a showstopper for me.



So, I’m not using dyne:bolic at this point.  I gave the CD to my musically-inclined son, however, and he used the “dock” method to install on his Windows laptop (to dock, simply copy the “dyne” folder from the CD onto the root of your hard drive — see Install on harddisk? Dock! — then use the “Nest” function to save your settings to the same folder, reboot with the CD, and you’re running db from the hard drive).  He’s had good fun using the drum machine and synth programs so far.

Note: one quirk which I noticed about db is that all of your drives are mounted with an extra layer of subfolder called simply “1.”  No doubt there’s a simple and good explanation for this, but it seems a bit odd to me.

Agave – A Handy Web Design Tool

Exploring Ubuntu Studio, I discovered a utility I’ve never seen before.

Agave is, among other things, a handy program for finding harmonious new colour schemes you can use on web pages.

I used it to choose the colours for the parent page of this site — Kevin Kennedy’s Web Portal — and I love the results (YMMV).

Sorting Out My Music Library

I have about 140GB of music which I have ripped from my CD collection or downloaded.  Since I was moving files around anyhow and eliminating my server, I decided I should reorganize my music library a little.  It contains files in several formats, with many duplicates.  I’m not finished, but I did make significant progress using the following techniques (some of which would work for any large collection of files of any type).

First, I decided that I would try to store everything in directories according to <Artist>, then <Album>.  I used to think that it didn’t matter how the files were organized because jukebox programs (like Rhythmbox, my usual choice) use tags to sort things out anyhow.  My son puts the <Artist> directories in <Genre> directories to help manage them.  I find that too arbitrary (plus it is a daunting task requiring even more hand-sorting).  I would’ve kept the <Artist> directories all together, but there are simply too many to be manageable, so I decided to put them in alphabetical ranges (<A-F>, <G-M>, etc.).

Secondly, I decided that I would try to name the files according to “<Artist> – <Title>.<extension>” format.  That doesn’t matter for the files which are already sorted into directories, but it was necessary for all the unsorted files named things like “Track 05.mp3″.

Tools which I found useful:

EasyTAG – Tag editor for MP3, Ogg Vorbis, FLAC, MusePack and Monkey’s Audio files, …

This program is not extremely friendly, but it bridges the gap between filenames and tags.  The tags can be used to create new filenames.  Beware that this can be a fairly slow process.  Some notes about Easytag:

  • you must navigate to the folder where your files are, but every time you move from one folder to the next in the program, it prompts you to save changes even if you haven’t made any;
  • be careful to select all of the files you want to modify in the middle window before proceeding;
  • select “Rename Files and Directory” from the “Scanner” menu.  Select the naming pattern you want from the drop down and click the greenish scan button.
  • note that the changes don’t actually happen until you navigate away from the current directory and confirm that you want to make the changes;
  • the file renaming works quite reliably, but takes a long time if you have many files.

Easytag has lots of other features, but I haven’t tried them yet.

Bulk Rename Utility

This is a great utility for renaming many files at once and previewing the results before you commit the changes.  Unfortunately, it doesn’t seem to work on directory names (though it does work on filenames across directories).

The rename command

This is a bash utility for renaming files according to a regular expression pattern.  It does work on directories as well as files.  I love sed and this tool is a quick and easy way to use it’s power for renaming.  For example, to replace underscores in file or directory names with spaces:

$rename ‘s/_/ /g’ *

USB Hard Drive Problem

I have a Western Digital 1TB external USB hard drive.  Under Debian, it worked some of the time, but would power itself off in the middle of major copy jobs.  The drive would unmount very ungracefully and my copy would end with “input/output error” for every file after the first few.

The drive works fine with my Ubuntu Hardy laptop, so I started digging to figure out why it wasn’t working in Debian.

After lots of research, I figured out the problem.  Some versions of the Linux kernel have a USB 2.0 module which doesn’t work.  I tried loading other kernels, but couldn’t come up with one that solves the problem for that drive.

To fix the problem, I had to just remove that module (as root):

#modprobe -r ehci_hcd

For a more permanent solution, you must rename the module so it doesn’t get reloaded on reboot.  There’s probably a more elegant way to do this, but here is what I did in my new Ubuntu Intrepid setup:

#cd /lib/modules/2.6.27-11-generic/kernel/drivers/usb/host/

#mv ehci-hcd.ko kk_ehci-hcd.ko

Without this module, the drive works fine, though very slowly.  I’ve moved all my video clips to the internal hard drive for editing.

Details here: Bug #88746 in linux-source-2.6.20 (Ubuntu): “ehci_hcd module causes I/O errors in USB 2.0 devices”

Choosing a Multimedia Linux Distro

For reasons I won’t go into yet, I decided to take my tried and true Debian server and turn it into a multimedia workstation.

The machine is a Shuttle barebones case with an Athlon XP 1700+ CPU, 2GB of RAM, and a ATI Radeon video card.  It contains two WD 200GB drives, plus I’ve added a WD 1TB (I love writing that!) external USB drive.

The system isn’t exactly ideal for it, but my ultimate goal is to use it for video editing with Cinelerra in particular.  My old Debian install had too many idiosyncracies to continue with, but I really wanted to stay with a distro in the Debian family, which I’m very familiar and happy with.

I narrowed the choice down to three options.  There are other similar distros out there which might do (64Studio, Musix, for example), but these seemed like the best options for me:

  1. d y n e : b o l i c



    Advantages
    • plenty of great software, including Cinelerra
    • uses low-resource window manager
    • seems to have a good user base and a bit of history behind it
    • made by Rastafarians!
    Disadvantages
    • doesn’t use Debian’s apt for package management, so you must wait for the next dyne:bolic release for upgrades
  2. pure:dyne



    Advantages
    • entirely Debian, with traditional package management
    • uses low-resource window manager
    • supported by Arts Council England
    Disadvantages
    • although it used to be based on dyne:bolic, the latest versions have been recreated from scratch from Debian, so there’s probably still work to do
  3. Ubuntu Studio



    Advantages
    • Ubuntu-based, so it will have plenty of support
    Disadvantages
    • uses Gnome
    • doesn’t include Cinelerra

I tested all three, but I ended up using Ubuntu Studio. Why? Because of hardware problems of one sort or another. I’ll explain more later.

First Post!

After a week of sysadmin Hell remaking my server into a multimedia workstation, I’ve decided I should document my experiences on this and future projects in case they may later be of use to me or somebody else.