Paperclip/ImageMagick issue

I'm using paperclip for uploading images, and I'm running into a weird error:

2 errors prohibited this billboard from being saved There were problems with the following fields:

    * Image /var/folders/bh/bh5FVAlvF5C38oqg94dcbU+++TI/-Tmp-/stream.1605.0 is not recognized by the 'identify' command.     * Image /var/folders/bh/bh5FVAlvF5C38oqg94dcbU+++TI/-Tmp-/stream.1605.0 is not recognized by the 'identify' command.

This only happens when I try to upload a .jpg. I can do .png and .gif just fine. I can run identify from the application root directory. Here is my model.

class Billboard < ActiveRecord::Base

  has_attached_file :image,                     :url => "/assets/:class/:id/:attachment/:style.:extension",                     :path => ":rails_root/public/assets/:class/:id/:attachment/:style.:extension",                     :default_url => "/images/billboard_default.jpg",                     :styles => {:main => "905x268#", :thumb => "100x30>"} end

jeremy-woertinks-imac:ecr jeremywoertink$ which identify /usr/local/bin/identify jeremy-woertinks-imac:ecr jeremywoertink$ identify -version Version: ImageMagick 6.6.2-1 2010-06-02 Q16 http://www.imagemagick.org Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC Features:

Has anyone had this issue?

Thanks, ~Jeremy

Is JPG support compiled into Imagemagick?

If you run identify directly on your image does it work? Or complain?

Philip Hallstrom wrote:

Is JPG support compiled into Imagemagick?

If you run identify directly on your image does it work? Or complain?

I ran the little test that generates the logo.gif. jeremywoertink$ /usr/local/bin/convert logo: logo.gif

The logo shows up fine, and I can upload it as my billboard.image just fine.

I installed ImageMagick through the macports.

Variants: graphviz, gs, hdri, jbig, jpeg2, lqr, mpeg, no_plus_plus, no_x11, perl, [+]q16, q32, q8, rsvg, universal, wmf

Paperclip.options[:image_magick_path] = "/opt/local/bin" Paperclip.options[:command_path] = "/opt/local/bin"

add something like these two commands to paperclip.rb in initializers folder

just point to right identify command path

catz wrote:

Paperclip.options[:image_magick_path] = "/opt/local/bin" Paperclip.options[:command_path] = "/opt/local/bin"

add something like these two commands to paperclip.rb in initializers folder

just point to right identify command path

The second one worked. I guess the first one is deprecated now? It's just weird that it would work for .gif and .png images without that initializer, but not for .jpg. Must be something with one of ImageMagick dependencies...

Thanks for the help!

~Jeremy