View Source Kino.Image (Kino v0.5.2)
A struct wrapping a binary image.
This is just a meta-struct that implements the Kino.Render
protocol, so that it gets rendered as the underlying image.
Examples
content = File.read!("/path/to/image.jpeg")
Kino.Image.new(content, "image/jpeg")
Link to this section Summary
Functions
Wraps the given binary content into the image struct.
Link to this section Types
Link to this section Functions
Specs
new(binary(), common_image_type() | mime_type()) :: t()
Wraps the given binary content into the image struct.
The given type be either :jpeg
, :png
, :gif
, :svg
or a string with image MIME type.