RMagick error using script/server but works in unit test

A

Aaron Johnson

Hello,

We have a method which converts a PDF from the filesystem to a
scaled JPEG data stream:

def lowres_jpeg_data
image = Magick::ImageList.new self.class.base_path + "/#{id}.pdf"
image.scale!(1000,1000)
image.format = 'JPEG'
image.to_blob
end

The unit test passes:

def test_lowres_jpeg_data
expected = File.read RAILS_ROOT + '/test/fixtures/images/
scales_and_crops/1_lowres.jpg'
image = Image.find 1
assert_equal expected, image.lowres_jpeg_data
end

However, when the method is called from the application running under
the webrick server in development mode we hit the following exception
using the same PDF file.

Magick::ImageMagickError (Postscript delegate failed `./var/cache/
1.pdf': ):

How can this work in a test but then not in the application?

OS X server 10.4.3
rmagick (1.9.3)
rails (0.14.2)
AFPL Ghostscript 8.51 (2005-04-18)
ImageMagick graphics/ImageMagick 6.2.4-3
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top