I keep seeing this error when I try to upload an image:
--
2 errors prohibited this panel from being saved

There were problems with the following fields:

Image C:/Users/Family/AppData/Local/Temp/stream,10032,0.png is not
recognized by the 'identify' command.
Image C:/Users/Family/AppData/Local/Temp/stream,10032,0.png is not
recognized by the 'identify' command.
--

If I have my model Panel (which needs an image attachment) look like
this, with the 'whiny' option set to false...

class Panel < ActiveRecord::Base
        belongs_to :section
        acts_as_list

        has_attached_file :image, :styles => { :medium => "300x300>",:thumb
=> "100x100>" }, :whiny => false

        validates_attachment_content_type :image, :content_type=>['image/
jpeg', 'image/jpg', 'image/png', 'image/gif'],
                :message => 'can only be jpeg, jpg, png, or gif',
                :unless => Proc.new { |photo| photo[:image].nil? }

end

....then I can upload an image. BUT I find that the following doesn't
work:

<%= image_tag panel.image.url(:medium) %>
<%= image_tag panel.image.url(:thumb) %>

...while the regular, <%= image_tag panel.image.url %> works fine.  I
have a feeling that the reason these two don't work is somehow tied to
my first problem, when :whiny was not set to false.  Maybe the first
error might somehow be responsible for the directory not getting made
for the :medium and :thumb...each images in the 'systems/images'
directory only has 'original' - no 'thumb' or 'medium.'
But I don't know!  All I know is that the directory for thumb and
medium don't get made, so those 2 lines of code won't work!

Please helppp...this has been very frustrating....

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to