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
28 29 30 31 |
# File 'lib/dimension/processors/image_magick.rb', line 28 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
20 21 22 |
# File 'lib/dimension/processors/image_magick.rb', line 20 def get_new_geometry self.class.new(@temp_file).geometry end |
#image_data ⇒ Object
11 12 13 |
# File 'lib/dimension/processors/image_magick.rb', line 11 def image_data IO.read(@temp_file) end |
#save! ⇒ Object
24 25 26 |
# File 'lib/dimension/processors/image_magick.rb', line 24 def save! FileUtils.mv(@temp_file, file) end |
#save_as(new_file_path) ⇒ Object
15 16 17 18 |
# File 'lib/dimension/processors/image_magick.rb', line 15 def save_as(new_file_path) return if new_file_path == @temp_file FileUtils.mv(@temp_file, new_file_path) end |