kornelski / cavif-rs

AVIF image creator in pure Rust
https://lib.rs/cavif
BSD 3-Clause "New" or "Revised" License
570 stars 27 forks source link

Move load_rgba #68

Closed kolserdav closed 1 year ago

kolserdav commented 1 year ago

In order to avoid duplicating the load_rgba method (as here for example: https://github.com/kolserdav/ravif-js/blob/master/src/lib.rs#L82) when using ravif as a library, it is made public, exported from ravif.

kolserdav commented 1 year ago

Eh, it would probably be more correct to split edits rustfmt and transfer load_rgba into separate commits. Or not use rustfmt at all. Since a lot of edits can be misleading at first glance, in fact, it just moved load_rgba and some dependencies. And rustfmt made automatic edits when saving.

kornelski commented 1 year ago

I deliberately don't use rustfmt in any of my projects. It has too many issues with inconsistent formatting and nonsensical choices of code layout to be applied unconditionally to everything. Please don't change the formatting.

kornelski commented 1 year ago

However, ravif is meant to be just a library for encoding with minimal dependencies (that's why it exists as a separate crate, not lib.rs in the cavif crate), so I'd rather not add dependencies on any codecs in ravif crate.

I think it's fine if you copy-paste image loading to your crate or use some other decoders.