pub enum DynImage {
    Jpeg(Jpeg),
    Png(Png),
    WebP(WebP),
}
Expand description

An enum wrapping the common functions shared by the different image formats

Variants

Jpeg(Jpeg)

Png(Png)

WebP(WebP)

Implementations

Tries to infer the file type from the file signature and calls the from_bytes method for the inferred format

Returns Ok(None) if the format isn’t supported.

Errors

This method fails if the file is corrupted or truncated.

Get the total size of the inner image once it is encoded

Create an encoder for the inner image

Trait Implementations

Formats the value using the given formatter. Read more

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Get the raw EXIF metadata of this image

Overwrites the pre-existing EXIF metadata of this image. Read more

Get the raw ICC Profile of this image

Overwrites the pre-existing ICC Profile of this image. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.