Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Add SDImageCoderWebImageContext coder option, which allow custom coder plugin, to receive the context option from top-level API #2405
New Pull Request Checklist
This merge request fixes / reffers to the following issues: ...
Pull Request Description
This is a solution for #2404 .
It's not surprise because in my mind, a decoder, should only consider about the image & image data, or anything related to the decoding option (Like animation or not, scale factor).
But however, if some custom coder plugin user, who want do some business logic related process, during image decoding. They have no choice to know the context. So I guess, maybe we can open this possibility.
Actually, this feature request, is from SDWebImageFLPlugin's PR, which will create a
The image decoding process, should always happend in image coder, but not hack into the setImageBlock. And that PR provide a better solution. And since all the decoding method is called from global queue, this can keep better performance.
@@ Coverage Diff @@ ## 5.x #2405 +/- ## ========================================= + Coverage 68.72% 68.82% +0.1% ========================================= Files 47 47 Lines 6634 6649 +15 ========================================= + Hits 4559 4576 +17 + Misses 2075 2073 -2