The documentation is still a work in progress, so if you have questions, you are welcome to create an issue. :-)
Supports the binary within this package.
Contains functions to easily generate different sizes of a picture that
can be used on webpages. Also offers the possibility to convert them into webp
format and is able to create
<picture> tags for the given images.
Currently this crate is only capable of converting
png files to webp using
So make sure that webp is installed on your computer.
The binary can be installed via
cargo install html5-picture. As stated
before, make sure webp is installed before using.
html5-picture --help for an overview of all parameters.
If you want to create three different sizes of the images in
with a conversion quality of 70%, enter the following command:
html5-picture ./assets 3 -q 70
This will convert your images and save them to
This folder is also the working directory make sure to not modify it while
the application is running.
If you pass
-i <folder_name> as parameter, the resulting files are
moved from the working directory to the given
<folder_name> after conversion
html5-picture ./assets 3 -q 100 -i ./assets-build
In this example the images are installted to
--force-overwrite flag will overwrite existing webp or
HTML5 picture tag files.
html5-picture ./assets 3 -q 100 -i ./dist -f
-p option, it is possible to save the
<picture> tags to disk.
However it is recommended to use it in combination with -m, which sets the
mountpoint in your tag files for you.
html5-picture ./assets 4 -i ./dist -p ./html5-tags -m /some/web-server/mountpoint
The pictures can be defined using JSON format.
html5-picture will read it
from stdin. This enables definition of all attributes such as
alt per image.
Contains default functions and traits.
Functions operating on the filesystem that is required for
Contains supporting functions that alter the file system.
HTML5 related functions, such as creation of picture tags.
Path processing that is required for
Generic helper functions.
Support for webp format. Used mainly for conversion.