[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#46971zhongwuzw wants to merge 1 commit intofacebook:mainfrom
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. |
cipolleschi
left a comment
There was a problem hiding this comment.
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. :) |
cipolleschi
left a comment
There was a problem hiding this comment.
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: 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: 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: facebook/react-native#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](facebook/react-native#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: facebook#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](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 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 .