-
Notifications
You must be signed in to change notification settings - Fork 24.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[iOS] Add png extension only if file exist when load local image #46971
[iOS] Add png extension only if file exist when load local image #46971
Conversation
@zhongwuzw news? 🙏 |
Hi, let me try to find someone to review. |
@fbp93 Hi, sorry for the delayed response. I contacted the RN team, and this week they’re busy with the 0.76 release and also have a team summit, so things will be slower than usual. |
ok thanks 👍 No worries, in the meanwhile I'm creating a patch with the fix and I'm using that one |
I'm a bit confused. This code is 5 years old, how come it stopped working recently? That said, the fix looks ok. It seems reasonable to add the extension only if the file exists. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my comment above.
@cipolleschi Hi, #37232 leads to the issue, we changes the sandbox file loading mechanism , and uses URLRequest to load the file image instead. So back to this PR, seems it's also reasonable to check whether file exist before add png extension. :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for digging into the issue and for working on the fix.
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@cipolleschi merged this pull request in 44f2a08. |
Summary: We have a report from OSS where Images are not displayed properly in case they are saved on disk with no extension. We previously had a fix attempt iwith [this pr](facebook#46971), but this was breaking some internal apps. This second attempt should work for both cases. ## Changelog: [iOS][Fixed] - Load images even when the extension is implicit Differential Revision: D68555813
Summary: Pull Request resolved: #48888 We have a report from OSS where Images are not displayed properly in case they are saved on disk with no extension. We previously had a fix attempt iwith [this pr](#46971), but this was breaking some internal apps. This second attempt should work for both cases. ## Changelog: [iOS][Fixed] - Load images even when the extension is implicit Reviewed By: cortinico Differential Revision: D68555813 fbshipit-source-id: bc25970aafe3e6e5284163b663d36e00b3df3d82
Summary: Pull Request resolved: #48888 We have a report from OSS where Images are not displayed properly in case they are saved on disk with no extension. We previously had a fix attempt iwith [this pr](#46971), but this was breaking some internal apps. This second attempt should work for both cases. ## Changelog: [iOS][Fixed] - Load images even when the extension is implicit Reviewed By: cortinico Differential Revision: D68555813 fbshipit-source-id: bc25970aafe3e6e5284163b663d36e00b3df3d82
Summary:
FIxes #46870.
To avoid many breaking changes, I modified the logic to add the PNG extension only if the file exists.
Changelog:
[IOS] [FIXED] - Add png extension only if file exist when load local image
Test Plan:
Demo in #46870 .