Skip to content

Image loading docs are not clear enough about required feature flags #13468

Closed

Description

Bevy version

  • bevy 0.13.2
  • cargo 1.77.1 (e52e36006 2024-03-26)
  • windows 11

What you did

Loaded a known good .exr from hdri-haven with AssetServer.

What went wrong

2024-05-22T04:28:44.401424Z ERROR bevy_asset::server: Failed to load asset 'C:\Users\...\...exr' with asset loader 'bevy_render::texture::image_loader::ImageLoader': Could not load texture file: Error reading image file C:\Users\...\...exr: failed to load an image: The image format OpenExr is not supported, this is an error in `bevy_render`.

Additional info

Here's a minimal repro, you can download a sample .exr from Poly Haven
To test, run the application, and drag and drop the .exr into the window.

use bevy::prelude::*;

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_systems(Update, drag_and_drop_exr)
        .run();
}

fn drag_and_drop_exr(
    mut events: EventReader<FileDragAndDrop>,
    asset_server: Res<AssetServer>,
) {
    // Add the new entity
    for event in events.read() {
        let FileDragAndDrop::DroppedFile {
            window: _,
            path_buf: path,
        } = event
        else {
            continue;
        };

        let Some(ext) = path.extension() else {
            continue;
        };

        if ext != "exr" {
            continue;
        }

        let _exr: Handle<Image> = asset_server.load(path.clone());
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-RenderingDrawing game state to the screenC-DocsAn addition or correction to our documentationD-TrivialNice and easy! A great choice to get started with Bevy

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions