class FastImage
- FastImage
- Reference
- Object
Defined in:
fastimage.crfastimage/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
-
.dimensions(source : URI | String | IO) : Tuple(UInt16 | Nil, UInt16 | Nil) | Nil
Initializes
FastImage
and tries to fetch image dimensions. -
.dimensions!(source : URI | String | IO) : Tuple(UInt16, UInt16)
Initializes
FastImage
and tries to fetch image dimensions. -
.type(source : URI | String | IO) : String | Nil
Initializes
FastImage
and tries to determine image type. -
.type!(source : URI | String | IO) : String
Initializes
FastImage
and tries to determine image type.
Instance Method Summary
- #process(source : String) : FastImage::Meta
- #process(uri : URI) : FastImage::Meta
- #process(io : IO) : FastImage::Meta
- #type_only? : Bool
Constructor Detail
Class Method Detail
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]
Initializes FastImage
and tries to fetch image dimensions.
Raises exception inherited from FastImage::Error
(FastImage::FormatError
, UnknownTypeError
, UnknownSourceError
, ReadError
)
if dimensions cannot be fetched.
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"
Initializes FastImage
and tries to determine image type.
Raises exception inherited from FastImage::Error
(FastImage::FormatError
, UnknownTypeError
, UnknownSourceError
, ReadError
)
if type cannot be determined.