# Paperclip - helppppp

**URL:** <https://www.ruby-forum.com/t/paperclip-helppppp/194934>\
**Category:** Rails\
**Created:** [September 14, 2010, 2:45am UTC](https://www.ruby-forum.com/t/paperclip-helppppp/194934 "2010-09-14T02:45:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![daze](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/96bed5/32.png) [@daze](https://www.ruby-forum.com/u/daze)\
**Post date:** [September 14, 2010, 2:45am UTC](https://www.ruby-forum.com/t/paperclip-helppppp/194934/1 "2010-09-14T02:45:39Z")

</div>

## 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…

---

<div class="post-metadata">

**Author:** ![daze](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/96bed5/32.png) [@daze](https://www.ruby-forum.com/u/daze)\
**Post date:** [September 14, 2010, 4:37am UTC](https://www.ruby-forum.com/t/paperclip-helppppp/194934/2 "2010-09-14T04:37:27Z")

</div>

If you’re getting the original image then you have ImageMagic setup  
correctly.

On Windows there is a bug in the current paperclip gem where the  
ImageMagick arguments are surrounded by single quotes, which windows  
doesn’t like.

Take a look at the console output to see the errors, try the commands  
that paperclip log outputs. If you have the single quote problem then  
update the paperclip.rb file:  
def quote\_command\_options(\*options)  
options.map do |option|  
option.split("’").map{|m| “#{m}” }.join("\’") #removed single  
quotes around #{m}  
end

Also note that in current version of ImageMagic the size in the styles  
hash no longer takes a final character, only the dimensions. So if you  
have :medium =\>‘300x300\>’, it now has to be just ‘300x300’

Hope this helps
