Giter Club home page Giter Club logo

Comments (20)

ScotterC avatar ScotterC commented on June 9, 2024

@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.

jeremybdk avatar jeremybdk commented on June 9, 2024

I will retest everything and get back to you but thanks for your quick answer !

from delayed_paperclip.

jeremybdk avatar jeremybdk commented on June 9, 2024

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.

jeremybdk avatar jeremybdk commented on June 9, 2024

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.

ScotterC avatar ScotterC commented on June 9, 2024

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.

ScotterC avatar ScotterC commented on June 9, 2024

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.

jeremybdk avatar jeremybdk commented on June 9, 2024

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.

ScotterC avatar ScotterC commented on June 9, 2024

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.

jeremybdk avatar jeremybdk commented on June 9, 2024

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.

haraldmartin avatar haraldmartin commented on June 9, 2024

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.

jeremybdk avatar jeremybdk commented on June 9, 2024

I tried but as I am still learning ruby I could not fix it

from delayed_paperclip.

ethier avatar ethier commented on June 9, 2024

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.

jrgifford avatar jrgifford commented on June 9, 2024

@ethier have you tried from git? I think that since #57 got merged in, it should work.

from delayed_paperclip.

ethier avatar ethier commented on June 9, 2024

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.

haraldmartin avatar haraldmartin commented on June 9, 2024

+1, i'm also on Rails version 3, using the master branch and experiencing the same thing.

from delayed_paperclip.

ketiko avatar ketiko commented on June 9, 2024

👍 Rails 4 using master branch has same problem.

from delayed_paperclip.

jrgifford avatar jrgifford commented on June 9, 2024

Darnit. I was hoping this was fixed. :\

I'll try and investigate this weekend.

from delayed_paperclip.

ethier avatar ethier commented on June 9, 2024

@jrgifford Any luck with this?

from delayed_paperclip.

mikaelprag avatar mikaelprag commented on June 9, 2024

+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.

ScotterC avatar ScotterC commented on June 9, 2024

#79 should fix this.

from delayed_paperclip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.