Class: UnprocessedImage

Inherits:
CarrierWave::Uploader::Base
  • Object
show all
Includes:
CarrierWave::MiniMagick
Defined in:
app/uploaders/unprocessed_image.rb

Overview

Copyright © 2010-2011, Diaspora Inc. This file is

licensed under the Affero General Public License version 3 or later.  See
the COPYRIGHT file.

Instance Method Summary collapse

Instance Method Details

#extension_white_listObject


12
13
14
# File 'app/uploaders/unprocessed_image.rb', line 12

def extension_white_list
  %w(jpg jpeg png gif)
end

#filenameObject


16
17
18
# File 'app/uploaders/unprocessed_image.rb', line 16

def filename
  model.random_string + File.extname(@filename) if @filename
end

#get_version_dimensionsObject


36
37
38
# File 'app/uploaders/unprocessed_image.rb', line 36

def get_version_dimensions
  model.width, model.height = `identify -format "%wx%h " #{file.path}`.split(/x/)
end

#orient_imageObject


22
23
24
25
26
27
# File 'app/uploaders/unprocessed_image.rb', line 22

def orient_image
  manipulate! do |img|
    img.auto_orient
    img
  end
end

#store_dirObject


8
9
10
# File 'app/uploaders/unprocessed_image.rb', line 8

def store_dir
  "uploads/images"
end