Comments (20)
@jaybbb Thanks for the update. This test is currently passing. Which is what tests that functionality. Any light you could shed on this would be appreciated.
from delayed_paperclip.
I will retest everything and get back to you but thanks for your quick answer !
from delayed_paperclip.
That's my model file :
has_attached_file :img, :styles => { :large => "1200x1200>", :medium => "800x800^", :feed => "189x189^", :email => "140x140^",:comment_email => "438x306^", :edit => "433x220^", :thumb => "80x80^", :small => "96x69^" ,:featured =>"380x281^" },
:convert_options => {:large => "-interlace Plane", :medium => "-gravity center -crop '800x800+0+0' -interlace Line", :feed => "-gravity center -crop '189x189+0+0' -interlace Line", :email => "-gravity center -crop '140x140+0+0' -interlace Line", :comment_email => "-gravity center -crop '438x306+0+0' -interlace Line", :edit => "-gravity center -crop '433x220+0+0' -interlace Line", :small => "-gravity center -crop '96x69+0+0' -interlace Line", :thumb => "-gravity center -crop '80x80+0+0' -interlace Line", :featured => "-gravity center -crop '380x281+0+0' -interlace Line" },
:default_url => "/defaults/avatar/:style/missing.png",
:url => ':s3_alias_url',
:s3_host_alias => 'dl3zix6ms0aea.cloudfront.net',
:path => ":class/:attachment/:id_partition/:style/:filename"
process_in_background :img, :only_process => [:large,:feed,:email,:comment_email,:thumb,:small]
All these style are processed in bg : [:large,:feed,:email,:comment_email,:thumb,:small] but with the new gem none of the other style are processed ( medium for example is not processed)
Any idea what might be going on ?
Thanks,
from delayed_paperclip.
Actually I don't know what might be wrong it now seems that all the styles are processed only in background.
What I am trying to achieve is to have some style processed at image upload and some other afterwards.
Thanks,
from delayed_paperclip.
As I played around with the code today I'm pretty sure I found the source of the problem. Delayed Paperclip inherits the only_process
option from Paperclips definitions. Move the only_process
to the has_attached_file
options and it'll work. I understand that this is probably not what you're going for but it's the current implementation. It won't require much to tweak the current library to do what you want though. It would require editing this method: https://github.com/jrgifford/delayed_paperclip/blob/master/lib/delayed_paperclip.rb#L54
from delayed_paperclip.
I just realized my own comment must be wrong because it should overwrite those defaults in the method I linked. This test is passing so I'm a bit miffed. Maybe the options aren't getting set.
Could you bring up your console and look up YourModel.img.delayed_options
and see if your options have gotten passed down?
from delayed_paperclip.
Here are the options that get passed down to my model :
{
:priority => 0,
:only_process => [
[0] :large,
[1] :feed,
[2] :email,
[3] :comment_email,
[4] :thumb,
[5] :small
],
:url_with_processing => true,
:processing_image_url => "http://dl3zix6ms0aea.cloudfront.net/:class/:attachment/:id_partition/original/:filename"
}
from delayed_paperclip.
The [0]
before large and the other integers are surprising. Definitely wasn't expecting that. A quick test would be to write the same test as before but try it with multiple styles for only_process. Care to try your hand at it?
from delayed_paperclip.
The [0] is just a awesome print formatting. I could try but I am new to rails and still learning the basics.
But I will try to look at it and see if I can find something.
Thanks
On 31 juil. 2013, at 19:14, "Scott Carleton" <[email protected]mailto:[email protected]> wrote:
The [0] before large and the other integers are surprising. Definitely wasn't expecting that. A quick test would be to write the same test as before but try it with multiple styles for only_process. Care to try your hand at it?
Reply to this email directly or view it on GitHubhttps://github.com//issues/40#issuecomment-21878494.
from delayed_paperclip.
Anyone found a fix for this?
I have the same problem; I want some styles to be processed directly and some in the background using Delayed Job, but the current version only process the styles I set as background styles (and not really have time to get into the full source now).
from delayed_paperclip.
I tried but as I am still learning ruby I could not fix it
from delayed_paperclip.
I can confirm this issue with both 2.5.1.0 and 2.6+. only_process
does not appear to fall back and process those styles that you do not specify in the array. I've been digging through the code and, unless I'm missing something, shouldn't the reprocess_without_delay!
be called for all of the styles that exist outside of the only_process array? I don't see that anywhere.
from delayed_paperclip.
@ethier have you tried from git? I think that since #57 got merged in, it should work.
from delayed_paperclip.
That was merged into the rails2 branch. I'm experiencing it with rails3. Or, are the branch names not reflective of the rails versions?
from delayed_paperclip.
+1, i'm also on Rails version 3, using the master branch and experiencing the same thing.
from delayed_paperclip.
👍 Rails 4 using master branch has same problem.
from delayed_paperclip.
Darnit. I was hoping this was fixed. :\
I'll try and investigate this weekend.
from delayed_paperclip.
@jrgifford Any luck with this?
from delayed_paperclip.
+1, A fix to this problem would be invaluable.
Edit: I diffed the code from pull request #62 and that seems to have done the trick?
from delayed_paperclip.
#79 should fix this.
from delayed_paperclip.
Related Issues (20)
- Latest commit to paperclip master breaks gem HOT 1
- undefined method `[]=' for nil:NilClass HOT 2
- Delayed Job w/ s3, Missing required :bucket option error HOT 11
- FFMPEG hangs/stalls when converting large files HOT 1
- Errors are silently swallowed instead of being raised to the background processor HOT 1
- Needs a failure callback
- Not saving original file - only those styles specified in only_process are created HOT 4
- paperclip-document style is not working with background
- Gem doesn't work with S3 HOT 4
- Handle Record Not Found Exceptions HOT 2
- NoMethodError: undefined method `fetch' for nil:NilClass with postgres HOT 1
- Release latest changes in master
- Support Priority of DelayedJob. HOT 2
- Processors not being called HOT 2
- Job failed to load: undefined class/module DelayedPaperclip
- Linking existing S3 object to Paperclip does not trigger Delayed::Job HOT 1
- Not generating cropped images when using papercrop
- Creates original style twice on S3
- How to skip process_in_background method call in some case
- Avoid creating jobs when nothing to process
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from delayed_paperclip.