paperclip

paperclip error while reporcessing after rails 3 upgrade

不想你离开。 提交于 2019-11-29 02:36:30
I have paperclip working uploading and saving different styles for images but when i go to crop the image using jcrop from railscasts tutorial it doesnt crop image. I get this error [paperclip] identify -format %wx%h '/var/folders/z+/z+KzOZBFE9irCpbMKKBGFk+++TI/-Tmp-/paperclip-reprocess20110118-19757-1wtrjaj-0[0]' 2>/dev/null [paperclip] convert '/var/folders/z+/z+KzOZBFE9irCpbMKKBGFk+++TI/-Tmp-/paperclip-reprocess20110118-19757-1wtrjaj-0[0]' -crop 28x32+13+15-resize "400x400>" '/var/folders/z+/z+KzOZBFE9irCpbMKKBGFk+++TI/-Tmp-/paperclip-reprocess20110118-19757-1wtrjaj-020110118-19757-1a5n558

Paperclip Amazon S3 setup with Heroku

我的梦境 提交于 2019-11-29 01:57:37
问题 has_attached_file :image, :storage => :s3, :s3_credentials => "#{RAILS_ROOT}/config/s3.yml", :path => "/:style/:filename" I'm not sure what :path => "/:style/:filename" is. I also want to to include the style for this attached image, is that what the :path is? the style I want is this: :styles => { :medium => "275x275>", :thumb => "175x155>" } Basically what's going on here is that I'm setting up on heroku and I'm having to use S3 which seems straightforward just not used to this attachment

Paperclip Error

让人想犯罪 __ 提交于 2019-11-29 01:42:39
I'm getting the following error in my development.log [paperclip] An error was received while processing: #<Paperclip::NotIdentifiedByImageMagickError: /tmp/stream28514-0 is not recognized by the 'identify' command.> And i've googled about this error and i found out that many people have solved this by adding this line Paperclip.options[:command_path] = "/usr/local/bin" However, i still get the same error even after adding that line! I've tried everything possible! Any help would be highly appreciated! Regards, Punit The Paperclip.options[:command_path] setting is for the location of your

Paperclip::Errors::NotIdentifiedByImageMagickError on Windows 7

社会主义新天地 提交于 2019-11-29 00:43:38
I'm going through Mattan Griffel's "One Month Rails" ( http://onemonthrails.com/ ) class. I'm trying to use the paperclip gem to upload images. Initial install and usage went fine, until he added a line to reduce the size of images. This was placed in app/models/pin.rb as shown in his tutorial: has_attached_file :image, styles: { medium: "320x240>" } It worked until the styles: {} part was added. I have also updated my partial to pass in the :medium method. I'm using: paperclip (3.4.1),cocaine (0.5.1) and rails (3.2.12). I have seen other posts where this was fixed with homebrew, but I'm on a

Get absolute URL for paperclip attachment

霸气de小男生 提交于 2019-11-29 00:40:12
问题 Is it possible to get the absolute URI for a Paperclip attachment? Right now, the problem is that the production environment is deployed in a sub-URI (on Passenger: RackBaseURI ), but <paperclip attachment>.url returns the Rails-app relative URI ( /system/images/... ). Is there a way to get the absolute URI for Paperclip attachments? I'm using Paperclip v2.7 and Rails 3.2.8. 回答1: try URI.join(request.url, @model.attachment_name.url) or URI(request.url) + @model.attachment_name.url It's safe

AWS::S3::S3Object.url_for - How to do this with the new AWS SDK Gem?

谁说我不能喝 提交于 2019-11-28 22:52:34
I've been using this forever with paperclip and aws-s3: def authenticated_url(style = nil, expires_in = 90.minutes) AWS::S3::S3Object.url_for(attachment.path(style || attachment.default_style), attachment.bucket_name, :expires_in => expires_in, :use_ssl => true) end The new paperclip uses the AWS-SDK gem, which breaks this giving the error: undefined method `url_for' for AWS::S3:Class Anyone know how to get this method to work with the new AWS-SDK gem? To generate a url using the aws-sdk gem you should use the AWS::S3Object#url_for method. You can access the S3Object instance from a paperclip

Is it possible to configure Paperclip to produce HTTPS urls?

有些话、适合烂在心里 提交于 2019-11-28 21:00:31
I'm using Paperclip to manage user-uploaded images on a site that is served entirely under HTTPS. In order to avoid the silly security warnings on IE7/IE8, I need to also serve these images over SSL. I typically render my images using something like the following: <%= image_tag @product.image.url(:large) %> where class Product < ActiveRecord::Base has_attached_file :image, :styles => { :large => {:geometry => "616x450#"} }, :storage => :s3, :s3_credentials => {:access_key_id => "xxx", :secret_access_key => "xxx"}, :path => ":attachment/:id/:style/:basename.:extension", :bucket => CONFIG['s3

Multiple files upload with Rails 3 and paperclip on heroku

寵の児 提交于 2019-11-28 19:58:47
I need an interface on my Rails 3 app to upload multiple files to Amazon S3 (because i'm on heroku), possibly with progress bars. I've easily managed how to set up paperclip and upload single files, but i'm really lost now on how to go ahead. Please can you give me some advices? It's 2 days i'm searching across all the internet, but i can't find a working solution ** EDIT ** I really can't understand... I'm going mad 'cause I'm losing too many hours on this... please help me. If I try to open the example app cited by Johnny I only get this (and in my app it is the same): Where is the UI? Is

How do I find an image on a page with Cucumber / Capybara in Rails 3

ぐ巨炮叔叔 提交于 2019-11-28 19:55:38
问题 I am using Cucumber / Capybara with Rails 3 and am trying to validate the existence of an image after upload. I'm not sure how to check the url of the image to validate it. I have the following scenario: Scenario: Create new listing Given I am on the new listing page When I fill in "listing_name" with "Amy Johnson Photography" And I attach the file "features/support/test_image.jpg" to "listing_images_attributes_0_photo" And I press "Create" Then I should see "Amy Johnson Photography" And I

Getting width and height of image in model in the Ruby Paperclip GEM

拜拜、爱过 提交于 2019-11-28 17:43:03
问题 Trying to get the width and height of the uploaded image while still in the model on the initial save. Any way to do this? Here's the snippet of code I've been testing with from my model. Of course it fails on "instance.photo_width". has_attached_file :photo, :styles => { :original => "634x471>", :thumb => Proc.new { |instance| ratio = instance.photo_width/instance.photo_height min_width = 142 min_height = 119 if ratio > 1 final_height = min_height final_width = final_height * ratio else