Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add imageproc to sic_image_engine behind a conditional compilation feature flag #410

Merged
merged 3 commits into from
May 14, 2020

Conversation

foresterre
Copy link
Owner

@foresterre foresterre commented May 13, 2020

Features for sub crates are support, but only one package deep from the workspace root package. Since we added imageproc conditionally to our sic_image_engine sub package and used to have the sic_cli crate depend on the sic_image_cli while the root package only contained a main function with a call to sic_cli, we had a package structure two levels deep, thus not being able to use the conditional sic-image-engine/imageproc-ops feature transitively.

This PR re-integrates the sic_cli crate into the workspace root package, so we can work around this Cargo limitation on conditional compilation.

Future PR's will add similar features for our parsers (i.e. when necessary), and will start implementing actual support for various imageproc operations.

To enable, the crate should be built with cargo [...] --features "sic-image-engine/imageproc-ops"

closes #395

With:
   cargo run --features 'sic_image_engine/imageproc-ops' -- -i resources/1x1_a.png -o target/o.png
It now works though; even on stable! yay!

Seems that that is regarded as a feature:
- rust-lang/cargo#2851 (comment)
…ageproc-features

# Conflicts:
#	Cargo.lock
#	components/sic_cli/Cargo.toml
@foresterre foresterre changed the title Experiment/imageproc features Add imageproc to sic_image_engine behind a conditional compilation feature flag May 14, 2020
@foresterre foresterre added A-crate-image Area: changes related to the image crate in the core component A-image-engine Area: changes related to the image engine A-crate-imageproc Area: changes related to the imageproc crate and removed A-crate-image Area: changes related to the image crate in the core component labels May 14, 2020
@foresterre foresterre merged commit b6389c8 into master May 14, 2020
@foresterre foresterre deleted the experiment/imageproc-features branch May 14, 2020 09:29
@foresterre foresterre linked an issue May 25, 2020 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-crate-imageproc Area: changes related to the imageproc crate A-image-engine Area: changes related to the image engine
Projects
None yet
1 participant