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

Worker creating styles on wrong "Original" #153

Open
mccallumjack opened this issue Sep 8, 2015 · 0 comments
Open

Worker creating styles on wrong "Original" #153

mccallumjack opened this issue Sep 8, 2015 · 0 comments

Comments

@mccallumjack
Copy link

I posted this question on Stack Overflow but I thought it might be more relevant to ask it here.

http://stackoverflow.com/questions/32467102/paperclip-image-uploading-to-s3-with-delayed-paperclip-is-uploading-a-duplicate

Basically I have 2 images being uploaded at once into the same s3 directory, with different style_names. The upload works fine without the "process_in_backgrounds", but once they are made into background jobs, the first image is creating styles based off the second images' "original". I think I understand why it is happening, as it must be overwriting the "Original", but I'm not sure how to get around it. Any ideas?

Uploading: [A,B]

Expecting: [A1,A2,A3,A4,B1,B2,B3,B4]

Getting: [B1,B2,B3,B4,B5,B6,B7,B8]

  has_attached_file :image,
                    :styles => {
                      :img      =>   ['768x432#', :jpg, :quality => 70],
                      :imgx2    =>   ['1536x864#',:jpg, :quality => 70],
                      :img_thumb    => ['288x162#',  :jpg, :quality => 70],
                      :img_thumbx2  => ['480x480#',  :jpg, :quality => 70]
                    },
                    :convert_options => {
                      :img           => '-set colorspace sRGB -strip',
                      :imgx2         => '-set colorspace sRGB -strip',
                      :img_thumb     => '-set colorspace sRGB -strip',
                      :img_thumbx2   => '-set colorspace sRGB -strip'
                    },
                    :default_url => "/images/:style/missing.png",
                    :url =>':s3_domain_url',
                    :path => "/:class/:vanity_url/:parsed_style"

  has_attached_file :logo,
                    :styles => {
                      :logo     =>   ['220x150', :png, :quality => 70],
                      :logox2   =>   ['440x300',:png, :quality => 70],
                      :logo_thumb   => ['280x50',  :png, :quality => 70],
                      :logo_thumbx2 => ['560x100', :png, :quality => 70]
                    },
                    :convert_options => {
                      :logo          => '-set colorspace sRGB -strip',
                      :logox2        => '-set colorspace sRGB -strip',
                      :logo_thumb    => '-set colorspace sRGB -strip',
                      :logo_thumbx2  => '-set colorspace sRGB -strip'
                    },
                    :default_url => "/images/:style/missing.png",
                    :url =>':s3_domain_url',
                    :path => "/:class/:vanity_url/:parsed_style"

  validates_attachment_content_type :image, content_type: /\Aimage\/.*\Z/
  validates_attachment_content_type :logo, content_type: /\Aimage\/.*\Z/

  process_in_background :image
  process_in_background :logo
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

1 participant