add a image-crate
feature to allow using much less dependencies
#819
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an experimental idea for reducing the amount of dependencies in some projects.
image
has around 15 more dependencies, but is only used in a few places in macroquad:macroquad::Image
from a image file of any formatmacroquad::Texture
from a image file of any formatmacroquad::Image
as a PNG fileFor a user that does not need these features, those dependencies are unneeded. This PR adds a crate feature
image-crate
that in on by default. If it is disabled,image
and the three functions above will not be compiled with macroquad.For instance, it would be possible to convert an
image
buffer to amacroquad::Image
once and then store themacroquad::Image
's byte representation on the disk, to avoid having to useimage
again.If a user had
default-features = false
inCargo.toml
for some strange reason (it has no effect right now, since there are no default features right now), this would break their code, but to fix it they would just have to removedefault-features = false
or addfeatures = ["image-crate"]
, which seems easy enough.