Struct html5_picture::core::Config[][src]

pub struct Config {
    pub input_dir: PathBuf,
    pub scaled_images_count: Option<u8>,
    pub install_images_into: Option<PathBuf>,
    pub force_overwrite: bool,
    pub quality_webp: Option<u8>,
}

Converts the images (currently png only) of the input folder to webp format. It also has the ability to create multiple versions of the input images having different sizes. See -s for further details. Additionally it automatically generates HTML5 tag files for you to be able to integrate them in a webpage easily.

Depends on cwebp, so make sure webp is installed on your pc!

Fields

input_dir: PathBuf

The directory containing all images that should be processed.

scaled_images_count: Option<u8>

The source image width is divided by this option (value + 1). Afterwards the source image is scaled (keeping the aspect ratio) to these widths before convertion. Useful if you want to have multiple sizes of the image on the webpage for different breakpoints.

Example:

Input image dimensions: 6000x962

Scaled images count: 3

Resulting converted images:

[filename]               [dimensions]

original_filename        6000x962

original_filename-w4500  4500x751

original_filename-w3000  3000x501

original_filename-w1500  1500x250
install_images_into: Option<PathBuf>

Installs the converted and sized pictures into the given folder.

force_overwrite: bool

If true, existing files are overwritten if install_images_into is set.

quality_webp: Option<u8>

Defines the quality of cwebp conversion.

Trait Implementations

impl Clap for Config[src]

impl Debug for Config[src]

impl FromArgMatches for Config[src]

impl IntoApp for Config[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.