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

recreate_versions! prepends and appends version to filename #1362

Closed
synoptase opened this issue Apr 8, 2014 · 8 comments
Closed

recreate_versions! prepends and appends version to filename #1362

synoptase opened this issue Apr 8, 2014 · 8 comments
Labels

Comments

@synoptase
Copy link

Issue is quite similar to #1164, with some other side effect.

With this model

require 'carrierwave/processing/rmagick'

class Uploader < CarrierWave::Uploader::Base
  include CarrierWave::RMagick

  def cache_dir
    "/tmp/cache"
  end

  def process_uri(uri)
    URI.parse(uri)
  end

end

class PictureUploader < Uploader

  def reprocess_file!
    cache_stored_file!
    retrieve_from_cache!(cache_name)
    recreate_versions!(:small)
  end

  version :small, :if => :is_a_small_pic? do
     ...
  end
end

Everything works fine on the first file generation.
It also works when i call recreate_versions! without any parameters. But when i call recreate_versions!(:small) my newly generated file will look like this small_<filename>_small.jpg.

Overriding full_filename method doesn't change anything.

@ghost
Copy link

ghost commented Mar 4, 2015

Is the only work around here to recreate all versions? or is there a fix for this?

@thomasfedb
Copy link
Contributor

@synoptase Is this bug still present in the latest version of carrierwave?

@thomasfedb thomasfedb added the bug label Nov 28, 2015
@synoptase
Copy link
Author

Haven't updated my carrierwave gem lately. Don't plan to until at least january.

@thomasfedb
Copy link
Contributor

@synoptase what version are you using?

@synoptase
Copy link
Author

Something like this:

carrierwave (0.10.0)
      activemodel (>= 3.2.0)
      activesupport (>= 3.2.0)
      json (>= 1.7)
      mime-types (>= 1.16)
    carrierwave-mongoid (0.7.1)
      carrierwave (>= 0.8.0, < 0.11.0)
      mongoid (>= 3.0, < 5.0)
      mongoid-grid_fs (>= 1.3, < 3.0)
    carrierwave_direct (0.0.14)
      carrierwave
      fog
      uuidtools

@thomasfedb
Copy link
Contributor

Thanks @synoptase, you're using the latest version.

@Grafikart
Copy link

Grafikart commented Nov 2, 2017

It looks like filename is called when doing a recreate_versions! (I'm using 1.2.1). I don't thinks it's the desired behaviour since it should use the name in the database and add the version name (like it does when calling model.image.{version_name}.url)

@mshibuya
Copy link
Member

Could not reproduce, maybe because #1879 have changed the version recreation much.
Please let us know if this is still an issue.

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

No branches or pull requests

4 participants