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.
imagehas around 15 more dependencies, but is only used in a few places in macroquad:macroquad::Imagefrom a image file of any formatmacroquad::Texturefrom a image file of any formatmacroquad::Imageas a PNG fileFor a user that does not need these features, those dependencies are unneeded. This PR adds a crate feature
image-cratethat in on by default. If it is disabled,imageand the three functions above will not be compiled with macroquad.For instance, it would be possible to convert an
imagebuffer to amacroquad::Imageonce and then store themacroquad::Image's byte representation on the disk, to avoid having to useimageagain.If a user had
default-features = falseinCargo.tomlfor 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 = falseor addfeatures = ["image-crate"], which seems easy enough.