g r o t t o 1 1

Peeve Farm
Breeding peeves for show, not just to keep as pets
  Blog \Blôg\, n. [Jrg, fr. Jrg. "Web-log".
     See {Blogger, BlogSpot, LiveJournal}.]
     A stream-of-consciousness Web journal, containing
     links, commentary, and pointless drivel.


On My Blog Menu:

InstaPundit
USS Clueless
James Lileks
Little Green Footballs
As the Apple Turns
Entropicana
Cold Fury
Capitalist Lion
Red Letter Day
Eric S. Raymond
Tal G in Jerusalem
Secular Islam
Aziz Poonawalla
Corsair the Rational Pirate
.clue

« ? Blogging Brians # »





Book Plug:

Buy it and I get
money. I think.
BSD Mall




 10/6/2003 -  10/8/2003
 9/29/2003 -  10/5/2003
 9/22/2003 -  9/28/2003
 9/15/2003 -  9/21/2003
  9/8/2003 -  9/14/2003
  9/1/2003 -   9/7/2003
 8/25/2003 -  8/31/2003
 8/18/2003 -  8/24/2003
 8/11/2003 -  8/17/2003
  8/4/2003 -  8/10/2003
 7/28/2003 -   8/3/2003
 7/21/2003 -  7/27/2003
 7/14/2003 -  7/20/2003
  7/7/2003 -  7/13/2003
 6/30/2003 -   7/6/2003
 6/23/2003 -  6/29/2003
 6/16/2003 -  6/22/2003
  6/9/2003 -  6/15/2003
  6/2/2003 -   6/8/2003
 5/26/2003 -   6/1/2003
 5/19/2003 -  5/25/2003
 5/12/2003 -  5/18/2003
  5/5/2003 -  5/11/2003
 4/28/2003 -   5/4/2003
 4/21/2003 -  4/27/2003
 4/14/2003 -  4/20/2003
  4/7/2003 -  4/13/2003
 3/31/2003 -   4/6/2003
 3/24/2003 -  3/30/2003
 3/17/2003 -  3/23/2003
 3/10/2003 -  3/16/2003
  3/3/2003 -   3/9/2003
 2/24/2003 -   3/2/2003
 2/17/2003 -  2/23/2003
 2/10/2003 -  2/16/2003
  2/3/2003 -   2/9/2003
 1/27/2003 -   2/2/2003
 1/20/2003 -  1/26/2003
 1/13/2003 -  1/19/2003
  1/6/2003 -  1/12/2003
12/30/2002 -   1/5/2003
12/23/2002 - 12/29/2002
12/16/2002 - 12/22/2002
 12/9/2002 - 12/15/2002
 12/2/2002 -  12/8/2002
11/25/2002 -  12/1/2002
11/18/2002 - 11/24/2002
11/11/2002 - 11/17/2002
 11/4/2002 - 11/10/2002
10/28/2002 -  11/3/2002
10/21/2002 - 10/27/2002
10/14/2002 - 10/20/2002
 10/7/2002 - 10/13/2002
 9/30/2002 -  10/6/2002
 9/23/2002 -  9/29/2002
 9/16/2002 -  9/22/2002
  9/9/2002 -  9/15/2002
  9/2/2002 -   9/8/2002
 8/26/2002 -   9/1/2002
 8/19/2002 -  8/25/2002
 8/12/2002 -  8/18/2002
  8/5/2002 -  8/11/2002
 7/29/2002 -   8/4/2002
 7/22/2002 -  7/28/2002
 7/15/2002 -  7/21/2002
  7/8/2002 -  7/14/2002
  7/1/2002 -   7/7/2002
 6/24/2002 -  6/30/2002
 6/17/2002 -  6/23/2002
 6/10/2002 -  6/16/2002
  6/3/2002 -   6/9/2002
 5/27/2002 -   6/2/2002
 5/20/2002 -  5/26/2002
 5/13/2002 -  5/19/2002
  5/6/2002 -  5/12/2002
 4/29/2002 -   5/5/2002
 4/22/2002 -  4/28/2002
 4/15/2002 -  4/21/2002
  4/8/2002 -  4/14/2002
  4/1/2002 -   4/7/2002
 3/25/2002 -  3/31/2002
 3/18/2002 -  3/24/2002
 3/11/2002 -  3/17/2002
  3/4/2002 -  3/10/2002
 2/25/2002 -   3/3/2002
 2/18/2002 -  2/24/2002
 2/11/2002 -  2/17/2002
  2/4/2002 -  2/10/2002
 1/28/2002 -   2/3/2002
 1/21/2002 -  1/27/2002
 1/14/2002 -  1/20/2002
  1/7/2002 -  1/13/2002
12/31/2001 -   1/6/2002
12/24/2001 - 12/30/2001
12/17/2001 - 12/23/2001
Friday, August 8, 2003
12:47 - Why don't I ever learn?

(top) link
I really should know better by now. I really ought to. My hand has been burned at least a dozen times by this, and yet I keep reaching for that protruding handle.

I upgraded ImageMagick again.

<moist towel to the forehead; steaming cup of cocoa held to my lips by concerned friends>

I don't know what possessed me to do it. Maybe the promise that the newest version contains better options to strip out IPTC and XML headers from JPEGs, so Internet Explorer doesn't choke and die upon trying to read images created by obscure software like Adobe Photoshop 7. (Magic command: mogrify +profile \* blah.jpg) Maybe it was the simple fact that my installed copy was a full minor version older than the current release, which always nags at me; no matter how well something is working right now, no matter how little poking and/or prodding it requires, I just can't leave well enough alone if there's a new and better version available. (About the only thing I've been able to prevent myself from upgrading is my scanner software, because even my must-upgrade-everything reflexes can't overcome the lessons I've so painfully learned on that front.)

Some years ago, I upgraded ImageMagick, only to find that all my server-side code-- which automatically generated thumbnails from uploaded images-- had started spewing all over itself, chewing up CPU, and creating some of the most hideously deformed thumbnail images ever. See, I was used to using the following command:

# mogrify -geometry 60x999 blah.s.jpg

...to scale the thumbnail proportionally to 60 pixels wide, with the height being whatever is consistent with the same aspect ratio and 60 pixels wide. A 600x400 picture would become a 60x40 thumbnail. The "999" was a special key number, you see-- it told ImageMagick to scale proportionally. Apparently they'd never bothered to code a proper option for only specifying one dimension, so this hack was the best they could do.

So I upgraded, and found that my thumnails were now... 60 pixels wide, and 999 pixels tall. They'd removed the special handling.

Now I use "9999" for that command. It's still an awful hack, but at least it isn't chewing up my CPU as it tries to blow everything up to a thousand vertical pixels every time someone uploads something. At least, until they change something else and I have to make it "99999".

So now I install the new version, mentally silencing my inner voice and its dire warnings against I-have-no-idea-what, and my script tries to resize a thumbnail. What should happen, but:

mogrify: No decode delegate for this image format (blah.jpg).


...Really?

I spent about half an hour on the phone with Chris, a fellow warrior in the image-archives trenches. We do numerous experiments, trying to see whether it was GIF support that had broken (the thumbnail was actually a GIF that I'd renamed to .jpg, for reasons that are too complex to get into here), or if my JPEG library had been eaten by disk moths, or if it required X11 and KDE now in order to run its command-line tools, or whatever stupid-ass thing they'd decided to change about the program this time.

Turned out, though, it wasn't ImageMagick's fault. Sort of. Rather, it was the fault of whoever's in charge of its FreeBSD port, or (to go to the Root Causes), the spate of lawsuits that keep spewing out from every popular image format every time the company that holds the patents on it goes out of business and releases its spore-lawyers in a last-ditch Samson maneuver to rake in whatever money might possibly be in the property. Unisys did it, with GIF (though now they have a powerful new friend; the weird holding company that has the IP for JPEG did it.

And now, apparently so as to cover their ass, the ImageMagick porters have ifdef'd out the support for all the popular image formats, the ones ImageMagick is ostensibly designed to handle. JPEG. TIFF. PNG. PDF. TTF. JPEG2000. LZW-based GIF. Never mind that formats like PNG are specifically designed to be patent-free. Someone commented them out anyway.

We discovered it, incidentally, here:

# convert -list format
Format Mode Description
-------------------------------------------------------------------------------
...
JPC* rw- JPEG-2000 Code Stream Syntax
JPEG* --- Joint Photographic Experts Group JFIF format (62)
JPG* --- Joint Photographic Experts Group JFIF format
LABEL* r-- Image label

See that "---" where there's supposed to be read/writability? Ain't no JPEG support. And GIF says "LZW disabled", which I guess explains why a GIF I converted changed from 30K to 50K.

So here's what to do, if you're on FreeBSD and want to avoid pain. Before building your ImageMagick port, set up these environment variables:

# setenv WITH_JPEG yes
# setenv WITH_PNG yes
# setenv WITH_TIFF yes
# setenv WITH_HDF yes
# setenv WITH_FPX yes
# setenv WITH_JBIG yes
# setenv WITH_JPEG2000 yes
# setenv WITH_LCMS yes
# setenv WITH_TTF yes
# setenv WITH_WMF yes
# setenv WITH_SVG yes
# setenv WITH_DPS yes
# setenv WITH_PDF yes

Feel free to omit any of these if you don't need them. Also, to get LZW-based GIF:

# setenv USA_RESIDENT yes

Please don't set that variable if you're a terrorist.

Then recompile. And wait for the next version to get rolled into the ports, which will contain a new -strip option, which will replace the hacky old +profile \*. Then upgrade again, and prepare for a whole new generation of pain.


Back to Top


© Brian Tiemann