Skip to content

Instantly share code, notes, and snippets.

@alfakini
Created June 13, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alfakini/8d97b94a37cbb0f855cd to your computer and use it in GitHub Desktop.
Save alfakini/8d97b94a37cbb0f855cd to your computer and use it in GitHub Desktop.
Test Syntax
class AccountLogoUploader < CarrierWave::Uploader::Base
include CarrierWave::MiniMagick
max_file_size = 5.megabytes
version :original do
process
end
private
def is_retina_resolution?(new_file)
image = MiniMagick::Image.open(self.file.file)
true if image[:height] >= 160*2 and image[:width] >= 160*2
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment