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

4.2.0 Breaking Change - Extract dimensions #670

Closed
patricklindsay opened this issue Jul 26, 2016 · 3 comments
Closed

4.2.0 Breaking Change - Extract dimensions #670

patricklindsay opened this issue Jul 26, 2016 · 3 comments

Comments

@patricklindsay
Copy link
Collaborator

For those who are getting the following message:

NoMethodError (undefined method `read_dimensions' for #<CkeditorPictureUploader:0x007fc9b4c717f0>
Did you mean?  extract_dimensions):
  carrierwave (0.11.2) lib/carrierwave/uploader/processing.rb:84:in `block in process!'

Your generated uploader needs to be updated;

Change line 31 from read_dimensions to extract_dimensions

For reference this is the breaking change

@galetahub
Copy link
Owner

Hm, I'm already did it.

@vemv
Copy link

vemv commented Aug 3, 2016

Please note that this was a breaking API change which didn't follow semver.

I suggest aliasing the method and bumping the version as a bugfix release.

Cheers - Victor

@trandaison
Copy link

trandaison commented May 13, 2017

Awesome, I have been running into a problem with config CkeditorPictureUploader and Cloudinary and this save the day.

Here is my uploader. The verison of CKeditor is 4.2.2

# encoding: utf-8
class CkeditorPictureUploader < CarrierWave::Uploader::Base
  include Ckeditor::Backend::CarrierWave
  include CarrierWave::MiniMagick
  include Cloudinary::CarrierWave

  process :extract_dimensions

  [:extract_content_type, :extract_size, :extract_dimensions].each do |method|
    define_method :"#{method}_with_cloudinary" do
      send :"#{method}_without_cloudinary" if self.file.is_a? CarrierWave::SanitizedFile
      {}
    end
    alias_method_chain method, :cloudinary
  end

  version :thumb do
    process :resize_to_fill => [118, 100]
  end

  version :content do
    process :resize_to_limit => [800, 800]
  end

  def extension_white_list
    Ckeditor.image_file_types
  end
end

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

No branches or pull requests

4 participants