Skip to content

bevy_image not available with bevy default-features=false #16563

@KirmesBude

Description

@KirmesBude

Bevy version

0.15.0

What you did

I am using Image and TextureFormatPixelInfo from bevy_image (respective bevy::image) and I want to only include only the relevant bevy parts by depending on bevy and setting deafult-features=false. rust-analyzer is suggesting the following import bevy::image::Image, but I get this error message when building:

error[E0432]: unresolved import `bevy::image`
  --> src/asset_loader.rs:11:5
   |
11 |     image::{Image, TextureFormatPixelInfo},
   |     ^^^^^ could not find `image` in `bevy`

For more information about this error, try `rustc --explain E0432`.
error: could not compile `bevy_titan` (lib) due to 1 previous error

What went wrong

I am not sure. There is no bevy_image feature, but I would have expected bevy_sprite (which is a feature I enable) to pull in bevy_image (and obviously I can still functionally use Image, just not directly because I can not import it).
See KirmesBude/bevy_titan@4c64775 for my specific reproducible issue.

Workaround: Enable any image feature e.g. "png"

Metadata

Metadata

Labels

A-RenderingDrawing game state to the screenC-BugAn unexpected or incorrect behaviorD-StraightforwardSimple bug fixes and API improvements, docs, test and examplesP-Compile-FailureA failure to compile Bevy appsS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions