This Space Intentionally Left Blank

8 Vendémiaire CCXII (September 29, 2003)

(System Stuff) Damn You ImageMagick!

I had an idea a while back and I've been trying to do stuff with dynamically generated images (which are in reality a composite of other images) using ImageMagick. I think I've got the perl code down pat to use Image::Magick (aka PerlMagick) to do what I want it to do, there's only one problem.

It doesn't work.

I shouldn't be doing anything wrong, in fact I even copied some of the code directly out of the ImageMagick documentation. Yet every single time I try to write to a file I get a segmentation fault. No other info than that, just 'Segmentation Fault'. Ok, I didn't really want to write to a file anyways, I'll write to STDOUT instead. Nope, can't do that because any images produced have errors and therefore can't be sent to a web browser.

To make things even more fun, if I redirect the output from STDOUT to a file using > I can sometimes view the resultant image in a web browser. There doesn't seem to be any logic to when it does this, it just does.

This is getting really irritating.

PerlMagick does exist as a package in the Debian archives…but the package depends on the perlapi package which disappeared when perl was moved from 5.6 to 5.8. Oops. Looks like it's time to try dpkg -i --force-depends and hope for the best, that is after I clean up all the files that make uninstall fails remove.

On another note entirely: This image caused me to make a 'what the hell?' face, followed by uncontrolled laughing. It's just odd but amusingly great at the same time.

Update: The webserver is now a horrible mismash of packages from stable, testing, and unstable, but everything seems to be working as long as I don't mind the fact that apt-get complains about unmet dependencies.

Update 2: It works! It works! It works!

I am a gilded miscreant

Try it out!

Yes, this is the idea I mentioned in the fridge poetry section. No, I don't plan on using it, I did it for the hell of it. If Nancy wants the script to do this she's free to have it rather than take pictures of the fridge.

Posted by g026r at 14:06
Comments

I thought about attempting to do something like that, but with CSS (so that images didn't have to be used to represent, basically, plain text).  I didn't investigate much, but it turns out that CSS doesn't have the option to put text on an angle.  Which of course makes sense, since I think most fonts don't have the ability to rotate.

Posted by peter at 8 Vendémiaire CCXII 18:48 (2003/09/29)

In the test you provided, spaces between words are ignored.  I think it should break on whitespace, and re-choose a new random angle.  Each character of whitespace should also determine the resultant spacing between words in the image.

I know this was your first attempt, and you were probably getting around to doing that stuff anyway.

Posted by peter at 8 Vendémiaire CCXII 18:50 (2003/09/29)

Also, one advantage of a real fridge picture is that it takes into account the overlap of some words, like how you had to place the 'ed' over the 'ly' to get the word you wanted.

Posted by peter at 8 Vendémiaire CCXII 18:52 (2003/09/29)

And finally...
Speaking of ImageMagick, I was hired a couple Christmases ago to write a wrapper library for ImageMagick for a Halifax company.  Basically, I just had to write a C API around the C API for ImageMagick, so that it did what they wanted it to do.  And implement a new image file type based on their specifications.  A long story short, I ended up not getting paid because ImageMagick wasn't able to process a high-resolution 21 page Tiff file without using up all the RAM, all the SWAP, and crashing the machine.  Yet another reason that that stage in my life was generally hellish.

Posted by peter at 8 Vendémiaire CCXII 18:57 (2003/09/29)

Man, that's totally plagiarism.  You're quoting my fridge poetry uncredited.  ; p

Siteicon Posted by Nancy at 8 Vendémiaire CCXII 19:07 (2003/09/29)

Can I help it if I never came up with any good ones? ; P

As for the spaces: I didn't notice that, I was basing it off of passing the phrase directly through the URL. In that case spaces are turned into %20 while a form turns them into +. Therefore it breaks when it hits %20, and not on +. That should be fixed now.

Now, If I was really good I'd fix it up so you could overlap words. But that's going to take a bit of time and involve me adding a border that's not the same colour as the transparency.

Siteicon Posted by g026r at 8 Vendémiaire CCXII 21:00 (2003/09/29)
Post a comment







Past Entries

Past Entries