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>,
pub single_threaded: bool,
}
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.
single_threaded: bool
If set, the processing is done single threaded.
Trait Implementations
Instantiate Self
from ArgMatches
, parsing the arguments as needed. Read more
Assign values from ArgMatches
to self
.
fn parse_from<I, T>(itr: I) -> Self where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
fn parse_from<I, T>(itr: I) -> Self where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
Parse from iterator, exit on error
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error> where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error> where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
Parse from iterator, return Err on error.
fn update_from<I, T>(&mut self, itr: I) where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
fn update_from<I, T>(&mut self, itr: I) where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
Update from iterator, exit on error
fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error> where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error> where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
Update from iterator, return Err on error.
StructOpt::clap
is replaced with IntoApp::into_app
(derived as part of Parser
)
Deprecated, StructOpt::clap
replaced with IntoApp::into_app
(derive as part of
Parser
) Read more
StructOpt::from_clap
is replaced with FromArgMatches::from_arg_matches
(derived as part of Parser
)
Deprecated, StructOpt::from_clap
replaced with FromArgMatches::from_arg_matches
(derive as part of
Parser
) Read more
StructOpt::from_args
is replaced with Parser::parse
(note the change in derives)
Deprecated, StructOpt::from_args
replaced with Parser::parse
(note the change in derives)
StructOpt::from_args_safe
is replaced with Parser::try_parse
(note the change in derives)
Deprecated, StructOpt::from_args_safe
replaced with Parser::try_parse
(note the change in derives)
StructOpt::from_iter
is replaced with Parser::parse_from
(note the change in derives)
Deprecated, StructOpt::from_iter
replaced with Parser::parse_from
(note the change in derives)
fn from_iter_safe<I, T>(itr: I) -> Result<Self, Error> where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
fn from_iter_safe<I, T>(itr: I) -> Result<Self, Error> where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
StructOpt::from_iter_safe
is replaced with Parser::try_parse_from
(note the change in derives)
Deprecated, StructOpt::from_iter_safe
replaced with Parser::try_parse_from
(note the
change in derives) Read more
Auto Trait Implementations
impl RefUnwindSafe for Config
impl UnwindSafe for Config
Blanket Implementations
Mutably borrows from an owned value. Read more