carrierwave

Heading into 2013, should I go with Dragonfly or Paperclip or Carrierwave? [closed]

為{幸葍}努か 提交于 2019-12-21 03:32:39
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . I am just another average joe hoping to jump onto the social network bandwagon. I'd like to know which photo uploading/resizing gem I

Carrierwave cannot remove image

孤者浪人 提交于 2019-12-21 02:38:22
问题 I'm using Carrierwave for uploading image now. All nice, except one, - when I add checkbox for removing uploaded image I get error: "Can't mass-assign protected attributes: remove_image". Form: ... <%= f.check_box :remove_image %> <%= f.label :remove_image, "remove image" %> ... Model: class Manufacturer < ActiveRecord::Base attr_accessible :name, :alias, :short_description, :long_description, :image, :publish, :position, :meta_keywords, :meta_description, :meta_title mount_uploader :image,

Convert base64 image to StringIO for Carrierwave

六眼飞鱼酱① 提交于 2019-12-20 10:55:30
问题 I am hoping someone can help me understand this. I have a base64 string for an image: "data:image/jpeg;base64,/9j/4AAQSkZJRgABA..." I would like to send it using ember's createRecord and commit(): this.get('store').createRecord(Emb.Painting, {name: newName, image: newImage}); Then I want to convert it to StringIO for carrierwave and save it: StringIO.class_eval { def original_filename; "stringiohaxx.jpg"; end } io = StringIO.new(Base64.decode64(params[:painting][:image])) @painting = Painting

Renaming uploaded files with Carrierwave

ⅰ亾dé卋堺 提交于 2019-12-20 08:48:48
问题 I'm using Carrierwave to upload files, and I have it working. My issue is attempting to change the name of the uploaded file. In the generated uploader.rb there is a method I think I should be using def filename "something.jpg" if original_filename basename = "what"+orginal_filename if original_filename, works basename = (0...8).map{65.+(rand(25)).chr}.join if original_filename # will create a random name for each version, e.g. the orginal, the thumb, and the filename in the db, useless end I

Custom error message for carrierwave 0.9.0 doesn't work for Rails 4

戏子无情 提交于 2019-12-20 04:12:11
问题 I use carrierwave 0.9.0 with Rails 4 and I'm trying to make a custom error message. After doing some search, I found this answer: en: errors: messages: extension_white_list_error: 'My Custom Message' I tried this by going to config/locales/en.yml then adding the code above, but nothing changed. The error message is still the same. There is also the same issue on github here, but no answers, I think this problem is specific just with Rails 4 but not sure, have you the same problem when you use

Missing requirement when using carrierwave and fog to upload file to S3

喜欢而已 提交于 2019-12-20 02:16:20
问题 I got this error Missing required arguments: aws_access_key_id, aws_secret_access_key . That seems weird because I already added carrierwave.rb in initializers folder. The access/secret key works perfectly when I use aws-sdk CarrierWave.configure do |config| config.fog_credentials = { provider: "AWS", aws_access_key_id: ENV["PUB-KEY"], aws_secret_access_key: ENV["SEC-KEY"] } config.fog_directory = ENV["mybucket"] end 回答1: Here's what my working one looks like: CarrierWave.configure do |config

Image corruption on upload to s3, production only. (carrierwave, engineyard)

帅比萌擦擦* 提交于 2019-12-19 19:51:56
问题 I am using carrierwave to upload images to amazon s3. This works great on development, but not when I push it to my server (engineyard cloud trial). The process works fine, no errors are thrown, and a link is given back. However, the actual image is corrupted, somehow. Here's one, for example: https://s3.amazonaws.com/ZenBucket/uploads/goal/photo/30/guinness-toucan.jpg Can anyone tell me how it's being corrupted, or what could be doing it? Edit: The first image upload attempt after deploying

Image corruption on upload to s3, production only. (carrierwave, engineyard)

橙三吉。 提交于 2019-12-19 19:51:01
问题 I am using carrierwave to upload images to amazon s3. This works great on development, but not when I push it to my server (engineyard cloud trial). The process works fine, no errors are thrown, and a link is given back. However, the actual image is corrupted, somehow. Here's one, for example: https://s3.amazonaws.com/ZenBucket/uploads/goal/photo/30/guinness-toucan.jpg Can anyone tell me how it's being corrupted, or what could be doing it? Edit: The first image upload attempt after deploying

Limit amount of file uploads with carrierwave

房东的猫 提交于 2019-12-18 18:26:27
问题 I have a User Model and have a Image model with carrierwave. I want to limit the amount of images an user could upload because I have a second form where the user goes to upload de images and I want him to able to upload only 3 images. Is there an elegante solution for this? Or do I have to make a custom validator that counts the amount of images the user as? 回答1: I guess your model is somehow similar to that : class User has_many :photos end class Photo belongs_to :user mount_uploader :file,

Getting first image in gif using carrierwave

扶醉桌前 提交于 2019-12-18 16:51:20
问题 Im using carrier wave to upload gifs which works just fine, the problem comes when i try to generate the thumb version and converting the gif into a jpeg with only the first image in the gif as the thumb, i get an error: LocalJumpError in ImagesController#create no block given (yield) app/controllers/images_controller.rb:21:in `new' app/controllers/images_controller.rb:21:in `create' Request Parameters: {"utf8"=>"✓", "authenticity_token"=>"lPEjP1WtPxFdizL2/FAWGHzOZPtecb5nKzKO8dg5ZdE=", "image