Class: Dato::Upload::Image

Inherits:
File
  • Object
show all
Defined in:
lib/dato/upload/image.rb

Instance Attribute Summary

Attributes inherited from File

#client, #source

Instance Method Summary collapse

Methods inherited from File

#file, #filename, #http_source?, #initialize, #upload

Constructor Details

This class inherits a constructor from Dato::Upload::File

Instance Method Details

#format_resource(upload_request) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/dato/upload/image.rb', line 8

def format_resource(upload_request)
  width, height = FastImage.size(file.path)

  super(upload_request).merge(
    width: width,
    height: height,
    format: FastImage.type(file.path).to_s
  )
end