A humble suggestion on round corner processor background color #2222
Replies: 1 comment 1 reply
-
Thank you for starting this discussion. You are being too polite. Please, there's no need for such modesty 😂. The issue here is that Kingfisher will by default save the processed result on the disk according to the original format of the image. Since JPEG images do not have an alpha channel, even if the background color is set to It's possible that I haven't fully understood your point... If what you're suggesting is something else, please clarify further. Thank you! Regarding the current design, I'd like to add a bit more. This was actually a rather difficult choice: Users of |
Beta Was this translation helpful? Give feedback.
-
First of all, yes, I've read your suggestion of using
.cacheSerializer(FormatIndicatedCacheSerializer.png)
.But what do you say if we change
RoundCornerImageProcessor.init
into:while extending
KFCrossPlatformColor
to have a.clear
property which returnsUIColor.clear
orNSColor.clear
?I hope this post won't annoy you. I tend to say it is merely a humble opinion, considering I'm making a suggestion on your suggestion (of making the cache a PNG).
You see, when setting an image with URL, the developer might not know the exact codec of the image. So when using
RoundCornerImageProcessor
without specifying thebackgroundColor
, which is then left asnil
, we're kinda having an inconsistency here.The first time the processor crops the image, the cropped area is transparent. But in the next app launch, it becomes white.
We can, of course, cache it as PNG, but it would costs more space than a JPG file.
We can specify the
backgroundColor
specifically as.clear
, but what about the consistency? Having anil
backgroundColor
, we are getting different results not only between different image codecs, but also between app launches.What do you think?
Hope I don't sound aggressive.
Beta Was this translation helpful? Give feedback.
All reactions