BMG50.COM · NODE 1 · 28600 BAUD--:--:--
Welcome to BMG50.com, caller.
Sysop: Rawg
Msg:#1162 of 1377Date:2007-10-30Subj:Processing Images in Rails - It's driving me nuts.

So I'm trying to convert a bunch of photos grabbed from a data feed, but It's just not working in Rails for some reason.

I first tried RMagick, then ImageScience, then using back-ticks to run the command line ImageMagick convert. All of them end up generating corrupt images.

I run the command line from the command prompt and it works fine. I run it from the console, and it still runs fine. It just won't run from my model.

The command line is:
sudo -u www /usr/local/bin/convert -geometry "1024x768>" -strip -quality 90 o-1.jpg l-1.jpg

I have removed the path for my blog. o-1.jpg is the original photo, l-1.jpg is the large size preview.

The errors I get are:
convert: Premature end of JPEG file o-2.jpg'.
convert: Corrupt JPEG data: premature end of data segment `o-2.jpg'.

It makes a jpg with the bottom half chopped off and all gray.

I'm thinking that Ruby or Rails is running out of memory while processing the image... maybe.. I don't know.

[1162/1377]->