Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Fix an issue, ASNetworkImageNode can't load image from bundle via NSURL.#1003

Closed
PonyCui wants to merge 1 commit intofacebookarchive:masterfrom
PonyCui:master
Closed

Fix an issue, ASNetworkImageNode can't load image from bundle via NSURL.#1003
PonyCui wants to merge 1 commit intofacebookarchive:masterfrom
PonyCui:master

Conversation

@PonyCui
Copy link
Copy Markdown

@PonyCui PonyCui commented Dec 27, 2015

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.

@facebook-github-bot
Copy link
Copy Markdown

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!

@facebook-github-bot
Copy link
Copy Markdown

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@appleguy
Copy link
Copy Markdown
Contributor

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

On Dec 26, 2015, at 11:48 PM, PonyCui notifications@github.com wrote:

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.

You can view, comment on, or merge this pull request online at:

#1003

Commit Summary

Fix an issue, ASNetworkImageNode can't load image from bundle via NSURL.
File Changes

M AsyncDisplayKit/ASNetworkImageNode.mm (2)
Patch Links:

https://github.com/facebook/AsyncDisplayKit/pull/1003.patch
https://github.com/facebook/AsyncDisplayKit/pull/1003.diff

Reply to this email directly or view it on GitHub.

appleguy pushed a commit that referenced this pull request Dec 28, 2015
Details discussed in #1003.  This PR supercedes that one.
@appleguy
Copy link
Copy Markdown
Contributor

@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 :).

#1006

@appleguy appleguy closed this Dec 28, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants