Fix an issue, ASNetworkImageNode can't load image from bundle via NSURL.#1003
Fix an issue, ASNetworkImageNode can't load image from bundle via NSURL.#1003PonyCui wants to merge 1 commit intofacebookarchive:masterfrom PonyCui:master
Conversation
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
|
Thanks so much for investigating this! I haven't used this component much with file URLs, but it is a fine idea. I will review your patch in the next few days. Sent from my iPhone
|
Details discussed in #1003. This PR supercedes that one.
|
@PonyCui Thanks to your test case, I was able to confirm that the fix I believe is more correct still works for your case. Feel free to check out the code change that I've made. Most importantly, please test it with any other code you have (such as any main project you're using where you first discovered this) to ensure it works as you expect. File a new GitHub issue for any other problems or questions you have, and feel free to email me at asyncdisplaykit@gmail.com any time :). |
Issue report and PR.
If only provide a file URL to ASNetworkImageNode.URL, it will not load the bundle image.
But if you deliver an UIImage to ASNetworkImgaeNode, that's not good.
The problem is, imageNode shouldCacheImage default values is true, but [UIImage imageNamed:_URL.path] requires an pure file name without any other characters.
See ASNetworkImageNode.mm:194, that's the issue code. If you use ASNetworkImageNode.mm:195 code, the issue solved.
This issue can be found at https://github.com/PonyCui/AsyncDisplayKit/tree/ASNetworkImageNode-BundleImageIssue branch, examples/ASNetworkImageNode-BundleImageIssue directory.