enum ImageOutputFormat

Defined in:

ext/kemal_gphoto2.cr

Enum Members

JPEG = 0

largest in size, yet quickest in terms of encoding speed

WEBP = 1

~half size of JPEG, 3rd to last in terms of encoding speed

AVIF = 2

smallest in size, yet slowest in terms of encoding speed

PNG = 3

worst quality, 2nd to last in terms of encoding speed

AUTO = 4

placeholder type to use along with .from_request?

Class Method Summary

Instance Method Summary

Class Method Detail

def self.from_path?(path : Path) : self | Nil #

Returns format based on a file extension from the given path, nil otherwise.


[View source]
def self.from_request?(request : HTTP::Request, formats : Enumerable(self)) : self | Nil #

Returns first of formats found to be supported by the request, nil otherwise.


[View source]
def self.from_request?(request : HTTP::Request, *formats : self) : self | Nil #

Returns first of formats found to be supported by the request, nil otherwise.


[View source]

Instance Method Detail

def auto? #

[View source]
def avif? #

[View source]
def extension : String #

[View source]
def extensions #

[View source]
def jpeg? #

[View source]
def mime_type : String #

[View source]
def png? #

[View source]
def to_slice(image : Vips::Image, **options) : Bytes #

Returns image in a self format.


[View source]
def webp? #

[View source]