struct Athena::ImageSize::Image
- Athena::ImageSize::Image
- Struct
- Value
- Object
Overview
Represents information related to a processed image.
pp AIS::Image.from_file_path "spec/images/jpeg/436x429_8_3.jpeg" # =>
# Athena::ImageSize::Image(
# @bits=8,
# @channels=3,
# @format=JPEG,
# @height=429,
# @width=436)
Defined in:
image.crimage_format.cr
Constructors
-
.from_file_path(path : String | Path) : self
Attempts to process the image at the provided path, raising an exception if either the images fails to process or is an unsupported format.
-
.from_io(io : IO) : self
Attempts to process the image from the provided io, raising an exception if either the images fails to process or is an unsupported format.
Class Method Summary
-
.from_file_path?(path : String | Path) : self | Nil
Attempts to process the image at the provided path, returning
nil
if either the images fails to process or is an unsupported format. -
.from_io?(io : IO) : self | Nil
Attempts to process the image from the provided io, returning
nil
if either the images fails to process or is an unsupported format.
Instance Method Summary
-
#bits : Int32 | Nil
Returns the number of bits per pixel within this image, if available.
-
#channels : Int32 | Nil
Returns the number of channels within this image, if available.
-
#format : Athena::ImageSize::Image::Format
Returns the format of this image.
-
#height : Int32
Returns the width of this image in pixels.
-
#size : Tuple(Int32, Int32)
Returns a tuple of this images size in the format of
{width, height}
. -
#width : Int32
Returns the width of this image in pixels.
Constructor Detail
Attempts to process the image at the provided path, raising an exception if either the images fails to process or is an unsupported format.
Attempts to process the image from the provided io, raising an exception if either the images fails to process or is an unsupported format.
Class Method Detail
Attempts to process the image at the provided path,
returning nil
if either the images fails to process or is an unsupported format.
Attempts to process the image from the provided io,
returning nil
if either the images fails to process or is an unsupported format.
Instance Method Detail
Returns a tuple of this images size in the format of {width, height}
.