image-rs / image

Encoding and decoding images in Rust
Apache License 2.0
4.91k stars 611 forks source link

Rayon should not be available as default feature #2028

Open qarmin opened 1 year ago

qarmin commented 1 year ago

Currently I use image-rs library in 3 copies in my app.

One dependency is from my app, but two are from other libraries.

I want to disable rayon, because I use it for different calculations and I, but I cannot do this, because it is not currently possible to disable features in libraries that not allows to do this - e.g. imagepipe uses all default features without possibility to remove unnecessary features.

So to "fix" this, this feature should be disabled by default

Looks that ravif also uses rayon

fintelia commented 11 months ago

Before we'd be able to consider whether rayon should be one of the default features, we first need to make sure it can be toggled by features at all. Right now, a couple of our dependencies use rayon without placing it behind a feature. If you're interested in changing this, the first step would be going through each place we include rayon from and making making a PR to have it be optional instead

oligamiq commented 3 days ago

I too think rayon must not be the default.

oligamiq commented 2 days ago

The only crate dependent on rayon is exrs, and all others are already managed by features. I have submitted a pull request to separate the rayon-related parts of exrs into a feature, so let's switch to not having rayon as a default feature.

https://github.com/johannesvollmer/exrs/pull/241