o2sh / onefetch

Command-line Git information tool
https://onefetch.dev
MIT License
10.37k stars 280 forks source link

Bump image from 0.24.9 to 0.25.2 #1396

Closed musicinmybrain closed 1 week ago

musicinmybrain commented 3 months ago

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:

spenserblack commented 3 months 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.

musicinmybrain commented 3 months 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.

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:

It 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.

musicinmybrain commented 1 week ago

Rebased on main with the image crate features reduced as suggested.