Closed HeroicKatora closed 2 years ago
I think it is a good time to start thinking about a 0.24
and I agree with your list of items to consider. Under the first point we should probably also include removal of the deprecated submodules under image::math::*
(#1434)
My sense is that the biggest items for this release would/should be iterating the APIs for Pixel
, GenericImage
and DynamicImage
. The async and no_std points could also be quite impactful, but I'm not sure how far we'll be able to get on those in the near term.
The next
branch has been created, and CI enabled. The MSRV limit has also been removed.
I'd like to see more use of Option and Result return types where feasible to avoid panicking and make interfaces more ergonomic for users. There are several public facing APIs with recoverable states such as get_pixel
and get_pixel_mut
, ImageBuffer
functions that handle Option with expect
(but from_vec
returns an Option), and functions that assert_[eq]!
, some of which do return ImageResult
and some don't. More imageops
functions should probably return Result or Option. I understand some of these choices may have been made to maintain backwards compatibility.
I know efforts were made for GenericImage::opt_pixel
but that was reverted in #1245 and I don't see any issues for it other than #1243 discussing the name. I'd like to see access methods that don't panic in the next version of image
. Should I make a new issue to discuss that or use an existing issue like #1243 or #1340?
Another thing I've seen in a TODO in buffer.rs
was the 'static
bound on Pixel
and if that is still necessary there and in imageops.
Feel free to use #1243 for it. And Ive edited your points into the initial comment.
Regarding the MSRV policy, how will we handle it and which version should we choose. The situation changed a bit compared to our last choice:
Cargo.toml
, making it accessible to yet-to-be-developed tooling. In particular, an MSRV aware resolver is being planned.const
is ongoing. This doesn't necessarily affect us directly but it is pretty restrictive to place the same restriction on all dependencies. In particular there are some that can potentially benefit from calculating certain tables, initial state, etc at compile time (jpeg, various decompressors).-Z minimal-versions
to run the msrv tests. It does not break when new versions of dependencies are released but shouldn't be used in production either. We could also use specific lockfiles instead.1.48.0
1.50
(unstable is naturally on 1.56
)1.41
1.51
, 21.04 (Hirsuite Hippo) is on 1.50
Under Implementation is breaking, as a sub-point to
[ ] optional get_pixel methods (and more clarity on assert vs. Result)
Option
on the ImageBuffer
struct in a non-breaking manner but it hasn't been in a patch release for 0.23
. Breaking changes would occur if this function was added to traits like GenericImage
/GenericImageView
or the corresponding functions had their signatures changed.Should DynamicImage be made NonExhaustive?
Apparently it's not at the moment (Mentioned in #1552), but it looks like the kind of enum we'd want to extend without it being a breaking change.
Are there plans to do another 0.23.x release? I'm mostly interested because of #1538.
+1 on another 0.23.x release. Looks like there's been a bunch of additions since the last release; in particular I'd love to see https://github.com/image-rs/image/pull/1624 supported in a version on crates.io (https://github.com/jaredforth/webp/issues/7#issuecomment-987693204 for context).
We have collected some amount of cruft that could be fixed in a new major version. There is no single issue that is a pressing concern, some have workaround, but I'd want to arrive at somewhat of a consensus or plan nevertheless as in total it is awkward. In particular the Rust compiler has moved forward quite a bit. I'd make a
next
branch like last time, which I believe worked out quite well.The main issues that could be addressed:
Pure renames and restructing
imageproc
that are now more flexible (#1201)math
(#1434)Design issues
DynamicImage
, or a rework that would allow addressing this in a future minor changeextern crate alloc;
async
(#1397) but we'd need a sketch firstGenericImage
trait that makes it object safe (#784, #1406, #1118)Implementation is breaking
simplify the pixel trait (#1099, #956)GenericImage
(#1340,Seek
trait on readers: (#1183)ImageOutputFormat::Unknown
variant (https://github.com/image-rs/image/pull/1453#discussion_r593829446)'static
bound onPixel
(#1597 )get_pixel
methods (and more clarity on assert vs. Result)buffer
aboutslice::copy_within
usagereplace
andoverlay
signature (#1575)*Encoder::new
(#1605)DynamicImage
asnon_exhaustive
would be more future-proofUnanswered questions
build.rs
file that enables specific features for specific versions only but I'm somewhat concerned for the testability of such a design. Apart from const-generics, is there any particularly relevant Rust feature that we'd be willing to wait for?