Module: ImageMagickProcessor
- Defined in:
- lib/dimension/processors/image_magick.rb
Instance Method Summary collapse
- #close ⇒ Object
- #format ⇒ Object
- #geometry ⇒ Object
- #get_new_geometry ⇒ Object
- #image_data ⇒ Object
- #save! ⇒ Object
- #save_as(new_file_path) ⇒ Object
Instance Method Details
#close ⇒ Object
30 31 32 33 |
# File 'lib/dimension/processors/image_magick.rb', line 30 def close log "Removing temp file: #{@temp_file}" FileUtils.rm_f(@temp_file) end |
#format ⇒ Object
7 8 9 |
# File 'lib/dimension/processors/image_magick.rb', line 7 def format image_details[:format] end |
#geometry ⇒ Object
3 4 5 |
# File 'lib/dimension/processors/image_magick.rb', line 3 def geometry [image_details[:width], image_details[:height]] end |
#get_new_geometry ⇒ Object
22 23 24 |
# File 'lib/dimension/processors/image_magick.rb', line 22 def get_new_geometry self.class.new(@temp_file).geometry end |
#image_data ⇒ Object
11 12 13 14 |
# File 'lib/dimension/processors/image_magick.rb', line 11 def image_data @current_path = path if @current_path.nil? IO.read(@current_path) end |
#save! ⇒ Object
26 27 28 |
# File 'lib/dimension/processors/image_magick.rb', line 26 def save! FileUtils.mv(@temp_file, file) end |
#save_as(new_file_path) ⇒ Object
16 17 18 19 20 |
# File 'lib/dimension/processors/image_magick.rb', line 16 def save_as(new_file_path) return if new_file_path == @temp_file FileUtils.mv(@temp_file, new_file_path) @current_path = new_file_path end |