- Where Developers Learn, Share, & Build Careers
I am using the paperclip gem to upload and resize images. This setup works fine. I am capable of displaying uploaded images. The problem comes when I try to resize the uploaded image
Here is a snippet from the model file
has_attached_file: picture,:. Size = & gt; {: Small = & gt; "150x150">.} When I try to upload the image I get this error
photo / var / folders / gram / gram -SegRMHuOkSlYtTMkO8U +++ TI / -Tmp- / file.jpg Not recognized by the 'Identity' command. I'm sure the file is JPG image data, JFIF standard 1.01, comment: "Producer: using GD- jpeg v1.0 (IJ" < Here is the file order
file.jpg I'm not sure, but in our application we do the same thing and it works. Our code looks like this: has_attached_file: image ,: styles = & gt; {= small = & gt; "280x173 #" ,: Medium => "635x393 #"}, convert_options = & gt; all = & Gt; "-Quality 80"}, # ,: default_style = & gt; moderate: default_url = & gt; "/images/study/nophoto.jpg" validates _tagment_size: image,: less_than => 10. megabyte is valid_datetime_type_type: image ,: content_type = & gt; ['image / gif', 'image / png', 'image / x-png', 'image / jpeg' , 'Image / pjpeg', 'image / jpg'] I see the difference, you may have to provide convert_options to be able to resize.
Comments
Post a Comment