* Move image loading code used by get_image_metadata from templates to imageproc
* resize_image: Compute image resize op beforehand and return metadata to caller
* get_image_metdata: Use a serializable response struct
* imageproc: Add integration tests
* imageproc: Assume webp is lossy
* get_image_metadata: Use webp crate for decoding WebP, image is still not very good at it
* imageproc: Test read_image_dimensions in integration tests
* imageproc: Rename read_image_dimensions() as read_image_metadata()
* imageproc: Fix a regression in hash computation
* imageproc: Don't hardcode hashes in integration tests, pattern match them instead
* imageproc: Style fixes
* imageproc: Fix integration tests on Windows (hopefully)
* fix: webp quality level mismatch
* fix: hash collision using the same image ops
Using the same image operations, but for different formats, e.g. `.jpg` and
`.webp`, produced the same hash.
To differentiate between these, the image extension is added to the hash.
Clippy is returning some warnings. Let's fix or explicitly ignore
them. In particular:
- In `components/imageproc/src/lib.rs`, we implement `Hash` explicitly
but derive `PartialEq`. We need to maintain the property that two
keys being equal implies the hashes of those two keys are equal.
Our `Hash` implementations preserve this, so we'll explicitly ignore
the warnings.
- In `components/site/src/lib.rs`, we were calling `.into()` on some
values that are already of the correct type.
- In `components/site/src/lib.rs`, we were using `.map(|x| *x)` in
iterator chains to remove a level of indirection; we can instead say
`.copied()` (introduced in Rust v1.36) or `.cloned()`. Using
`.copied` here is better from a type-checking point of view, but
we'll use `.cloned` for now as Rust v1.36 was only recently
released.
- In `components/templates/src/filters.rs` and
`components/utils/src/site.rs`, we were taking `HashMap`s as
function arguments but not generically accepting alternate `Hasher`
implementations.
- In `src/cmd/check.rs`, we use `env::current_dir()` as a default
value, but our use of `unwrap_or` meant that we would always
retrieve the current directory even when not needed.
- In `components/errors/src/lib.rs`, we can use `if let` rather than
`match`.
- In `components/library/src/content/page.rs`, we can collapse a
nested conditional into `else if let ...`.
- In `components/library/src/sorting.rs`, a function takes `&&Page`
arguments. Clippy warns about this for efficiency reasons, but
we're doing it here to match a particular sorting API, so we'll
explicitly ignore the warning.