class FastImage

Defined in:

fastimage.cr
fastimage/meta.cr
fastimage/meta/bmp.cr
fastimage/meta/cur.cr
fastimage/meta/gif.cr
fastimage/meta/ico.cr
fastimage/meta/jpeg.cr
fastimage/meta/png.cr
fastimage/meta/psd.cr
fastimage/meta/svg.cr
fastimage/meta/tiff.cr
fastimage/meta/webp.cr
fastimage/simple_exif.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(**options) #

[View source]

Class Method Detail

def self.dimensions(source : URI | String | IO) : Tuple(UInt16?, UInt16?)? #

Initializes FastImage and tries to fetch image dimensions. Returns nil if dimensions cannot be fetched.

FastImage.dimensions("https://file-examples.com/wp-content/uploads/2017/10/file_example_PNG_3MB.png")
=> [2200, 1467]

[View source]
def self.dimensions!(source : URI | String | IO) : Tuple(UInt16, UInt16) #

Initializes FastImage and tries to fetch image dimensions. Raises exception inherited from FastImage::Error (FastImage::FormatError, UnknownTypeError, UnknownSourceError, ReadError) if dimensions cannot be fetched.


[View source]
def self.type(source : URI | String | IO) : String? #

Initializes FastImage and tries to determine image type. Returns nil if type cannot be determined.

FastImage.type("https://file-examples.com/wp-content/uploads/2017/10/file_example_PNG_3MB.png")
=> "png"

[View source]
def self.type!(source : URI | String | IO) : String #

Initializes FastImage and tries to determine image type. Raises exception inherited from FastImage::Error (FastImage::FormatError, UnknownTypeError, UnknownSourceError, ReadError) if type cannot be determined.


[View source]

Instance Method Detail

def process(source : String) : FastImage::Meta #

[View source]
def process(uri : URI) : FastImage::Meta #

[View source]
def process(io : IO) : FastImage::Meta #

[View source]
def type_only? : Bool #

[View source]