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§
Source§impl CommandFactory for Config
impl CommandFactory for Config
Source§fn into_app_for_update<'b>() -> Command<'b>
fn into_app_for_update<'b>() -> Command<'b>
CommandFactory::command_for_update
Source§impl FromArgMatches for Config
impl FromArgMatches for Config
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches
to self
.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches
to self
.Source§impl Parser for Config
impl Parser for Config
Source§fn parse_from<I, T>(itr: I) -> Self
fn parse_from<I, T>(itr: I) -> Self
Source§fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
Source§fn update_from<I, T>(&mut self, itr: I)
fn update_from<I, T>(&mut self, itr: I)
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more