Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delayed Paperclip does not generate all styles in latest version of Paperclip (v 3.0.4) #67

Open
timols opened this issue Jun 3, 2012 · 4 comments

Comments

@timols
Copy link

timols commented Jun 3, 2012

Currently, due to API changes in Paperclip from v3.0 onwards, the reprocess! method that is called from process_delayed! does not reprocess all of the styles since the post_processing instance attribute on the attachment is set to false after being created. When reassigned/saved this is not updated to true again.

This is easily overcome by updating the relevant method as follows:

  def process_delayed!
    self.job_is_processing = true
    self.post_processing = true
    reprocess!
    self.job_is_processing = false
  end

Happy to provide a pull request if appropriate.

@tarellel
Copy link

You sir, are very much appreciated

@tommeier
Copy link
Collaborator

tommeier commented Jul 2, 2012

Thanks mate, wrapped it in my recent commits to get S3 working:

aguilarsoto#2

So that now works for 2.7 -> 3.1.2 of paperclip and S3 uploads.

@timols
Copy link
Author

timols commented Jul 2, 2012

Nice. Thanks for issuing the pull request.

@dsadaka
Copy link

dsadaka commented Oct 2, 2012

I am experiencing this same issue even with the following gems:

From Gemfile:
gem 'delayed_paperclip', '2.4.5.2', :git => 'git://github.com/tommeier/delayed_paperclip', :branch => 'fix_312'
gem 'paperclip', '~> 2.7.0'

From bundle show:

  • delayed_paperclip (2.4.5.2 c23a537)
  • paperclip (2.7.0)

My environment is

Rails 3.1.6
Ruby version:
ruby 1.8.7 (2011-02-18 patchlevel 334) [i686-linux], MBARI 0x8770, Ruby Enterprise Edition 2011.03

Is it my Ruby verison? Too old perhaps?

My photo model contains:
has_attached_file :file,
:styles => STYLES,
:default_style => DEFAULT_STYLE,
:convert_options => {
:new_square => '-auto-orient -thumbnail "x80" -resize "80x<" -resize 50% -gravity north -crop 40x40+0+0 +repage',
:new_thumbnail => '-auto-orient -thumbnail "x120" -resize "120x<" -resize 50% -gravity north -crop 60x60+0+0 +repage',
:new_small => '-auto-orient -thumbnail "x320" -resize "320x<" -resize 50% -gravity north -crop 160x160+0+0 +repage'
},
:storage => USE_S3 ? :s3 : :filesystem,
:s3_credentials => "#{::Rails.root.to_s}/config/amazon_s3.yml",
:path => USE_S3 ? PATH_FORMAT : ":rails_root/public/paperclip/#{PATH_FORMAT}",
:url => USE_S3 ? ":s3_alias_url" : "/paperclip/#{PATH_FORMAT}",
:s3_host_alias => ::Rails.env =~ /^prod/ ? 'files.mobicious.com' : "files-#{::Rails.env}.mobicious.com",
:s3_headers => {'Cache-Control' => 'max-age=315576000', 'Expires' => 10.years.from_now.httpdate}

Paperclip.interpolates :updated_at_timestamp do |attachment, style|
Time.at(attachment.updated_at).strftime("%Y/%m/%d/%H%M%S")
end

#process_in_background :file

Note that process_in_background is commented out to disable delayed_paperclip. (It works without it but the delays are unacceptable now)

Please advise.

Thanks,
Dan

jrgifford referenced this issue in jrgifford/delayed_paperclip Oct 11, 2012
jrgifford referenced this issue in jrgifford/delayed_paperclip Oct 11, 2012
malandrina pushed a commit to hoteltonight/delayed_paperclip that referenced this issue Feb 21, 2014
Fix undefined method `[]' for nil:NilClass with Paperclip 3.5.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants