Skip to content

Commit

Permalink
Fix ImageLoader not being initialized with webp or pnm features (
Browse files Browse the repository at this point in the history
…#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`.
  • Loading branch information
rparrett authored Mar 7, 2024
1 parent 6f2ecdf commit a1974a4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/bevy_render/src/texture/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -131,6 +133,8 @@ impl Plugin for ImagePlugin {
feature = "bmp",
feature = "basis-universal",
feature = "ktx2",
feature = "webp",
feature = "pnm"
))]
{
app.init_asset_loader::<ImageLoader>();
Expand Down

0 comments on commit a1974a4

Please sign in to comment.