Sha256: b10aaefb747d0d8a6f63c46018ad7c136212acb99b4f3b1bd877f29cb3bed7d3

Contents?: true

Size: 779 Bytes

Versions: 1

Compression:

Stored size: 779 Bytes

Contents

module TaliaCore
  module DataTypes
    
    # A FileRecord that contains an image.
    class ImageData < FileRecord
      
      # return the mime_type for a file
      def extract_mime_type(location)
        # TODO: This may work automatically if all the MIME types
        # are configured correctly (?)
        case File.extname(location).downcase
        when '.bmp'
          'image/bmp'
        when '.cgm'
          'image/cgm'
        when '.fit', '.fits'
          'image/fits'
        when '.g3'
          'image/g3fax'
        when '.gif'
          'image/gif'
        when '.jpg', '.jpeg', '.jpe'
          'image/jpeg'
        when '.png'
          'image/png'
        when '.tif', '.tiff'
          'image/tiff'
        end
      end
       
    end
    
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
talia_core-0.7.0 lib/talia_core/data_types/image_data.rb