Closed AregevDev closed 8 months ago
See also https://github.com/image-rs/image/issues/741. https://stackoverflow.com/questions/15526107/acronyms-in-camelcase is also an interesting discussion.
@HeroicKatora what are your thoughts on this, I have thought about it before, but I have sort of mixed feelings. On one hand, more consistency with the api guidelines and the library itself would be nice, ~but the breaking changes are quite large and the question is if the (relatively small) improvements are worth it.~ Forget that, as I was writing it I realized that it is stupid, we have many more breaking changes to go before 1.0, and we should definitely do what we can to make the library as good as possible before then.
It's a good idea to change it for the color types for sure. For the formats I don't see such a great benefit but for consistency it should be done as well. This is relevant for #865 where the ColorType
is getting updates anyways.
Should I change these and send a PR?
@AregevDev Feel free to send remaining changes to the branch next
, e.g. the decoder still have this problem. It's been noted before that WebP
is the more precise capitailization and we've also been in favor of this form in #1056. Remember that change for decoders, there we have WebpDecoder
instead of WebPDecoder
.
Ok, which changes do I need to submit then, in addition to the formats?
Most of the format specific wrappers, encoders. We could also remove the format prefix from these. The Rust api guidelines correct version is gif::Encoder
, not dxt::DXTEncoder
for example.
DXTVariant
and variantsDXTDecoder
*Decoder
and *Encoder
are mostly in capitals (see above decisions)PNMSubtype
(prefix also slated for removal imho)I'm against all of our decoders to be called Decoder
. If we're concerned about repeated typing, I think it would be way better just to place/re-export them at the crate root. Once we make the image-core split I think that this will make even more sense: each module would otherwise just be a couple of re-exports. (The same rule is often ignored for repeating the crate name in the types is exports so that wouldn't be an issue).
Fixing the capitalization would be good though.
I noticed there that acronym enums has a SCREAM naming, which should be changed according to the naming conventions. This includes all the
ImageFormat
variants and some of theColorType
variants.This is very minor and could be changed easily, however I wouldn't rush to do it as many projects use this crate and this change can break things...
First, I want to know if it is known and get a response.
Thanks!