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
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.
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
fn parse_from<I, T>(itr: I) -> Self where
T: Into<OsString> + Clone,
I: IntoIterator<Item = T>,
fn parse_from<I, T>(itr: I) -> Self where
T: Into<OsString> + Clone,
I: IntoIterator<Item = T>,
Parse from iterator, exit on error
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error> where
T: Into<OsString> + Clone,
I: IntoIterator<Item = T>,
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error> where
T: Into<OsString> + Clone,
I: IntoIterator<Item = T>,
Parse from iterator, return Err on error.
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
Auto Trait Implementations
impl RefUnwindSafe for Config
impl UnwindSafe for Config
Blanket Implementations
Mutably borrows from an owned value. Read more