Module: Dimensions

Defined in:
lib/dimensions.rb,
lib/dimensions/io.rb,
lib/dimensions/reader.rb,
lib/dimensions/scanner.rb,
lib/dimensions/version.rb,
lib/dimensions/exif_scanner.rb,
lib/dimensions/jpeg_scanner.rb,
lib/dimensions/tiff_scanner.rb,
lib/dimensions/tiff_scanning.rb

Defined Under Namespace

Modules: IO, TiffScanning Classes: ExifScanner, JpegScanner, Reader, Scanner, TiffScanner

Constant Summary collapse

VERSION =
"1.3.0"

Class Method Summary collapse

Class Method Details

.angle(path) ⇒ Object

Returns the rotation angle of the JPEG image at the given path. If the JPEG is rotated 90 or 270 degrees (as is often the case with photos from smartphones, for example) its width and height will be swapped to accurately reflect the rotation.



40
41
42
# File 'lib/dimensions.rb', line 40

def angle(path)
  io_for(path).angle
end

.dimensions(path) ⇒ Object

Returns an array of [width, height] representing the dimensions of the image at the given path.



22
23
24
# File 'lib/dimensions.rb', line 22

def dimensions(path)
  io_for(path).dimensions
end

.height(path) ⇒ Object

Returns the height of the image at the given path.



32
33
34
# File 'lib/dimensions.rb', line 32

def height(path)
  io_for(path).height
end

.width(path) ⇒ Object

Returns the width of the image at the given path.



27
28
29
# File 'lib/dimensions.rb', line 27

def width(path)
  io_for(path).width
end