jrgifford / delayed_paperclip

Process your Paperclip attachments in the background with delayed_job or Resque.
http://www.jstorimer.com/ruby/2010/01/30/delayed-paperclip.html
MIT License
402 stars 155 forks source link

Not showing processing image #156

Open ssoulless opened 9 years ago

ssoulless commented 9 years ago

Im using Rails 4.2.5 with ruby 2.1.4, delayed_job 4.1.1 and delayed_paperclip 2.9.1

Well this is my configuration, I have a model called Picture:

class Picture < ActiveRecord::Base
    belongs_to :ofert, dependent: :destroy

    has_attached_file :image,   :styles => { :medium => "300x300#", :thumb => "100x100>", :large => "600x400#", :morethumb => "50x50#", :ultrathumb => "25x25#" },
                                :default_url => "https://s3-sa-east-1.amazonaws.com/:s3_bucket/ofert_defaults/:style/brown_hat.jpg"

    validates_attachment_content_type :image, :content_type => /\Aimage\/.*\Z/
    validates_attachment_presence :image, :if => :isProduction?
    validates_attachment_size :image, :less_than => 5.megabytes

    process_in_background :image, processing_image_url: 'https://s3-sa-east-1.amazonaws.com/:s3_bucket/ofert_defaults/:style/brown_hat.jpg'

    #Checks if the current env is production, so we skip this validation on development
    def isProduction?
        Rails.env == 'production'
    end
end

when I create them the bakcground processing is occurring normally, however when I try to display the picture the image is broken, I mean it has the link of the image in amazon s3 but it is broken, I wait some seconds and reload the page and the images are shown as expected.

as you can see above I set the processing_image_url but it seems to not be working, I even tried to do the following:

<% if picture.image.processing? %>
  <strong>The image is being processed</strong>
<% else %>
  <%= link_to picture.image.url(:medium), data: { large: picture.image.url } do %>
    <%= image_tag picture.image.url(:thumb) %>
  <% end %>
<% end %>

However it is still not working... any ideas?

Streek commented 8 years ago

Same issue here.

Streek commented 8 years ago

Seems this gem is dead.

ScotterC commented 8 years ago

@streek not dead. It would appreciate contributions though.

danielbonnell commented 8 years ago

Any progress on this issue? I just installed the gem and I'm having the same problem.