Module: MetaData
- Defined in:
- lib/httpthumbnailer/plugin/thumbnailer.rb
Overview
ImageMagick Image.mime_type is absolutely bunkers! It goes over file system to look for some strange files WTF?! Also it cannot be used for thumbnails since they are not yet rendered to desired format Here is stupid implementaiton
Instance Method Summary collapse
Instance Method Details
#height ⇒ Object
12 13 14 |
# File 'lib/httpthumbnailer/plugin/thumbnailer.rb', line 12 def height @image.rows end |
#mime_type ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/httpthumbnailer/plugin/thumbnailer.rb', line 16 def mime_type #TODO: how do I do it better? format = @format || @image.format mime = case format when 'JPG' then 'jpeg' else format.downcase end "image/#{mime}" end |
#width ⇒ Object
8 9 10 |
# File 'lib/httpthumbnailer/plugin/thumbnailer.rb', line 8 def width @image.columns end |