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

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

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!

Example: html5-picture ./assets 3; Input image dimensions: 6000x962; Scaled images count: 3; Resulting converted images: original_filename 6000x962; original_filename-w4500 4500x751; original_filename-w3000 3000x501; original_filename-w1500 1500x250;

Fields

input_dir: PathBuf

The directory containing all images that should be processed.

scaled_images_count: 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.

install_images_into: Option<PathBuf>

Installs the converted and sized pictures into the given folder.

picture_tags_output_folder: Option<PathBuf>

The destination folder of HTML5 picture tag files.

mountpoint: Option<PathBuf>

Can be used in combination with -p, sets the mountpoint for links in the HTML tags.

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

Parse from std::env::args_os(), exit on error

Parse from std::env::args_os(), return Err on error.

Parse from iterator, exit on error

Parse from iterator, return Err on error.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

It’s common to have an “application context” struct (sometimes called config) that represents all the normalized values after being processed by the CLI. Read more

@TODO @release @docs

@TODO @release @docs

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

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.