Fix ImageLoader not being initialized with webp or pnm features (#12355)

# Objective

Fixes #12353

When only `webp` was selected, `ImageLoader` would not be initialized.

That is, users using `default-features = false` would need to add `png`
or `bmp` or something in addition to `webp` in order to use `webp`.

This was also the case for `pnm`. 

## Solution

Add `webp` and `pnm` to the list of features that trigger the
initialization of `ImageLoader`.
This commit is contained in:
Rob Parrett 2024-03-06 17:28:45 -07:00 committed by François
parent 2683dfeee8
commit 0767e62112

View file

@ -118,6 +118,8 @@ impl Plugin for ImagePlugin {
feature = "bmp",
feature = "basis-universal",
feature = "ktx2",
feature = "webp",
feature = "pnm"
))]
app.preregister_asset_loader::<ImageLoader>(IMG_FILE_EXTENSIONS);
}
@ -131,6 +133,8 @@ impl Plugin for ImagePlugin {
feature = "bmp",
feature = "basis-universal",
feature = "ktx2",
feature = "webp",
feature = "pnm"
))]
{
app.init_asset_loader::<ImageLoader>();