File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
crates/bevy_render/src/texture Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -91,13 +91,14 @@ impl AssetLoader for ImageLoader {
91
91
settings : & ' a ImageLoaderSettings ,
92
92
load_context : & ' a mut LoadContext < ' _ > ,
93
93
) -> Result < Image , Self :: Error > {
94
- // use the file extension for the image type
95
- let ext = load_context. path ( ) . extension ( ) . unwrap ( ) . to_str ( ) . unwrap ( ) ;
96
-
97
94
let mut bytes = Vec :: new ( ) ;
98
95
reader. read_to_end ( & mut bytes) . await ?;
99
96
let image_type = match settings. format {
100
- ImageFormatSetting :: FromExtension => ImageType :: Extension ( ext) ,
97
+ ImageFormatSetting :: FromExtension => {
98
+ // use the file extension for the image type
99
+ let ext = load_context. path ( ) . extension ( ) . unwrap ( ) . to_str ( ) . unwrap ( ) ;
100
+ ImageType :: Extension ( ext)
101
+ }
101
102
ImageFormatSetting :: Format ( format) => ImageType :: Format ( format) ,
102
103
} ;
103
104
Ok ( Image :: from_buffer (
You can’t perform that action at this time.
0 commit comments