paperclip

Can you identify the current dimensions of an image with Paperclip?

人走茶凉 提交于 2020-01-06 05:34:08
问题 I just updated the dimensions of an image thumbnail, and have been working on updating 28,000 photo objects. Unfortunately, this kind of process takes many processes over a long time to accomplish. In this process, some get rejected, and some processes get canceled. Is there a way to identify whether an image thumbnail has the current dimensions or not? 回答1: I'm unsure I understood your question but you can get the width and height of any file using Paperclip. geo = Paperclip::Geometry.from

Why is Paperclip failing silently in production + development?

久未见 提交于 2020-01-06 04:51:12
问题 I'm clueless as to what's going on with this because I have another app on the same server that receives and saves uploads just fine. No error messages, Paperclip even say's in the log it's saving the attachments. But the attachments don't get saved. Thoughts anyone? Also how would I test for this using RSpec/Capybara, because apparently my tests don't cover this. Running Paperclip 2.3.12, Rails 3.0.9, REE1.8.7 Production on RHEL5 / Apache , but runs on a different user than my other app's

Paperclip polymorphic styles

戏子无情 提交于 2020-01-05 12:14:30
问题 I have a polymorphic model where my attachment's styles are defined with Paperclip's lambda. Here is the problem: polymorphic properties such as attachable_id and attachable_type are both nil . There is no controller because I'm using ActiveAdmin. My Project model: class Project < ActiveRecord::Base has_many :attachments, as: :attachable, :dependent => :destroy accepts_nested_attributes_for :attachments, allow_destroy: true attr_accessible :floors, :intro, :name, :price, :square, :deadline,

Trouble with Paperclip and Ajax with Rails 3.2.8

白昼怎懂夜的黑 提交于 2020-01-05 09:25:09
问题 I am writting an application 100% ajax with rails 3.2.8 Everything was going great until I tried to upload photos of the employees to the employee management module. This is part of my code: At the Controller: class EmpleadosController < ApplicationController respond_to :js before_filter :require_user def index @empleados = Empleado.paginate( page: params[ :page ], joins: [:user,:contacto], select: 'empleados.id as id, empleados.user_id, empleados.contratado_el, empleados.despedido_el,

No route matches [GET] for Pinned Image

孤者浪人 提交于 2020-01-05 08:59:11
问题 When the current_user clicks the pin how can that image be saved to the current_user ? Button: <%= simple_form_for(@inspiration) do |f| %> <%= f.hidden_field :image_file_name, value: inspiration.image_file_name %> <%= f.hidden_field :image_content_type, value: inspiration.image_content_type %> <%= f.hidden_field :image_file_size, value: inspiration.image_file_size %> <%= button_tag(type: 'submit', class: "btn btn-primary") do %> <span class="glyphicon glyphicon-pushpin"></span> <% end %> <%

Rails paperclip not showing image

故事扮演 提交于 2020-01-05 08:54:10
问题 I am new to paperclip, and I wanted to see how it would work. I generated a simple model Monkey and got the following: rails g scaffold monkey description age:datetime rails g paperclip monkey facepic rake db:migrate Model class Monkey< ActiveRecord::Base has_attached_file :facepic, :styles => { :medium => "300x300>", :thumb => "100x100>" } end View new/edit <%= form_for @monkey, :url => monkies_path, :html => { :multipart => true } do |f| %> ... <div class="field"> <%= f.label :facepic %><br

Rails Paperclip with model association

烂漫一生 提交于 2020-01-05 08:00:04
问题 I have a page where I can view a product, and directly from this page the user can add and remove multiple images associated with the product. I'm using paperclip in a form to upload new file. Because multiple images can be saved for a product I created an image model belonging to the product model. It's not possible to use the default paperclip file input because of the association. My solution below is working, but I'm wondering if there's a better way in rails to accomplish this without

Paperclip combined with Imagemagick saves images but doesn't display them on the site

独自空忆成欢 提交于 2020-01-05 03:47:07
问题 I am using paperclip and Imagemagick to add images to a website. I have a form on the site for users to upload images. When I upload an image, it doesn't give any errors. When I check the rails console, the image is saved with the right size and all that. When I check the project folder, the images get saved in there too. But when I try to display, I get the following screen on the site(Only one image has been added, only the one on the left is supposed to show up, the missing tags on the

error facing while cropping photo using Paperclip in Rails 3

孤人 提交于 2020-01-04 06:12:35
问题 Hi i am trying to crop photo using paperclip and imagemagick. I am facing some error while cropping photo. following is the error stack: ?[32mCommand?[0m :: convert "C:/Users/Anand/AppData/Local/Temp/120120924-3568-tx 2bxy.jpg[0]" -crop 103x103+0+0 -auto-orient "C:/Users/Anand/AppData/Local/Temp/1 20120924-3568-tx2bxy20120924-3568-16dij9c" ?[32mCommand?[0m :: file -b --mime "C:/Users/Anand/AppData/Local/Temp/120120924- 3568-tx2bxy20120924-3568-16dij9c" [paperclip] Error while determining

error facing while cropping photo using Paperclip in Rails 3

ぐ巨炮叔叔 提交于 2020-01-04 06:12:26
问题 Hi i am trying to crop photo using paperclip and imagemagick. I am facing some error while cropping photo. following is the error stack: ?[32mCommand?[0m :: convert "C:/Users/Anand/AppData/Local/Temp/120120924-3568-tx 2bxy.jpg[0]" -crop 103x103+0+0 -auto-orient "C:/Users/Anand/AppData/Local/Temp/1 20120924-3568-tx2bxy20120924-3568-16dij9c" ?[32mCommand?[0m :: file -b --mime "C:/Users/Anand/AppData/Local/Temp/120120924- 3568-tx2bxy20120924-3568-16dij9c" [paperclip] Error while determining