Closed musicinmybrain closed 1 week ago
Can we disable default features? This is bringing in a lot of new dependencies and I'm not sure if we need them all.
Can we disable default features? This is bringing in a lot of new dependencies and I'm not sure if we need them all.
Sure, that’s feasible.
As of 0.24.9, the default features were:
default = ["gif", "jpeg", "ico", "png", "pnm", "tga", "tiff", "webp", "bmp", "hdr", "dxt", "dds", "farbfeld", "jpeg_rayon", "openexr", "qoi"]
As of 0.25.2, they are
default = ["rayon", "default-formats"]
default-formats = ["avif", "bmp", "dds", "exr", "ff", "gif", "hdr", "ico", "jpeg", "png", "pnm", "qoi", "tga", "tiff", "webp"]
avif = ["dep:ravif", "dep:rgb"]
So what I notice, looking at the above and at the diff https://github.com/image-rs/image/compare/v0.24.9...v0.25.2#diff-2e9d962a08321605940b5a657135052fbcef87b5e360662bb527c96d9a615542L63, I notice:
avif
was added to the default features, bringing in the ravif
crate (which has some new dependencies like loop9
, imgref
, avif-serialize
, rav1e
)jpeg_rayon
feature is gone and jpeg
now brings in zune-core
and zune-jpeg
– nothing to be done about this if you need JPEG supportrayon
was added to the default features, which enables multithreadingIt seems like rayon
is worthwile, because this is likely to speed up loading of images and therefore perceived responsiveness. The biggest way you could prune the dependency tree would be by omitting support for the AVIF format. I’ll add that to this PR. Let me know what you think.
Rebased on main
with the image
crate features reduced as suggested.
Breaking changes from 0.24 to 0.25 are described in https://github.com/image-rs/image/blob/main/CHANGES.md#version-0250.
This PR includes the following changes to adapt to
image
0.25:ImageOutputFormat
, previously deprecated and removed in 0.25, withImageFormat
color_quant
crate feature (forimpl ColorMap for NeoQuant
)