Skip to content
This repository has been archived by the owner on Oct 5, 2018. It is now read-only.

Processor options not used #171

Open
toddp opened this issue Apr 6, 2016 · 5 comments
Open

Processor options not used #171

toddp opened this issue Apr 6, 2016 · 5 comments

Comments

@toddp
Copy link

toddp commented Apr 6, 2016

I've created a Paperclip model which uses a 'processor' , which inherits from the Thumbnail example :

https://github.com/thoughtbot/paperclip/blob/master/lib/paperclip/thumbnail.rb

I've noticed that when I use Paperclip in the non-background-process way, those options are successfully passed to Imagemagick and my image is rotated as I expect (notice 'rotate 90') :

Command :: convert '/var/folders/9w/f7r7st_x52d9j7h26rvxnqtw3905xq/T/6fbbbcd16ebfdd1f1d03d140864cd39b20160405-8637-1p5qy48[0]' -rotate 90 -auto-orient -resize "250x" -crop "250x250+0+41" +repage -quality 60 '/var/folders/9w/f7r7st_x52d9j7h26rvxnqtw3905xq/T/d981b804e49e80ba21b044c34eedef3120160405-8637-6lpd8l'

however when I uncomment process_in_background, I see Imagemagick called without those options:

[ActiveJob] [DelayedPaperclip::Jobs::ActiveJob] [110b7d6e-e1ca-4b56-8f79-aa31448da970] Command :: convert '/var/folders/9w/f7r7st_x52d9j7h26rvxnqtw3905xq/T/b24982efc9699db5d6208187637a3f9e20160405-10356-19qn6fv[0]' -auto-orient -resize "250x" -crop "250x250+0+62" +repage -quality 60 '/var/folders/9w/f7r7st_x52d9j7h26rvxnqtw3905xq/T/c6e0a783d72f6edba85d22c20b9bcefb20160405-10356-1pv23gq'

I'm making a sample rails app as a minimal test case to demonstrate this. Is this a known issue?

I'm also using paperclip with aws-sdk 2.0 so I'm not on the latest gem version (of paperclip); I can try to upgrade that as well if it's helpful. I'm using the hash recommended for use with aws-sdk 2.0: 523bd4 .

@toddp
Copy link
Author

toddp commented Apr 6, 2016

sample project illustrating this bug created: https://github.com/toddp/delayed_paperclip_bug_171

@toddp
Copy link
Author

toddp commented Apr 6, 2016

FYI I discovered that attachment.reprocess_without_delay! doesn't have this problem, which makes a work-around possible for my use case; but it'd be nice to have the background processing also obey whatever options are passed.

@equivalent
Copy link

have the similar problem here. After introducing delayed_paperclip suddenly or rotation of images stopped working. Commenting out process_in_background enabled it again.

   has_attached_file :file,
     styles: {
       thumb: '100x100>',
       square: '400x400#',
       medium: '600x600>',
       screen: '1024x1024'
     },  
     convert_options: { :all => '-auto-orient' },
     processors: [:rotator],
     default_url: :placeholder

  process_in_background :file, processing_image_url: :placeholder

@equivalent
Copy link

equivalent commented Apr 29, 2016

@toddp, your idea of using attachment.reprocess_without_delay! works 👍 ...so my issue solved with this. Thank you dude

@fibrasek
Copy link

fibrasek commented Nov 10, 2017

This is not working, causing paperclip to fall in an endless loop. To solve the loop, theres a suggestion here, though this not trigger the processors with delayed_paperclip :/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants