-
Notifications
You must be signed in to change notification settings - Fork 567
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
Displaying image from thumbnailPath #22
Comments
I'm not sure if this has anything to do with React no longer using the Added to the Possible PR candidate? |
I'm confused. I then use that URI as such I still dont' get any results! Tips? |
Did you try This issue and the corresponding fix from #23 was specific to iOS. There may be a similar issue going on for the android paths which also do not have a file type suffix. Unlike in iOS however we are not in control of the android file name which means fixing this will likely require figuring out why react-native is not displaying images without a type suffix. What version of react-native are you using? |
I'm on |
this may require enhancing the core |
Did some more digging... from the UIImageClass docs (under Special Considerations) it seems that if the file type is PNG then you don't need to specify an extension, otherwise you do. So, it's possible that the thumbnails are not PNG's and so they were not being displayed, but adding a prefix worked. I guess the next thing to do is figure out what type they are stored as. |
It looks like it just writes the I'm not sure how this pans out for Android... Thoughts? |
Hm, thanks for figuring all that out. It would seem like more work needs to be done to enforce consistency in Android is a different beast since we do not need to copy the image to disk at all (we just retrieve the path to a pre-existing thumbnail). Fixing android thumbnails I think will require changes to Lets leave this open for further discussion / updates |
@morenoh149 so until that gets patched in the |
@Turg0n no clue |
This is a snippet that worked for me (in RN 0.18, iOS). if (rowData.thumbnailPath) {
return (
<Image
style={[styles.image]}
source={{ uri: rowData.thumbnailPath }}
defaultSource={require('./../../assets/images/profile_empty.png')}
width={40}
height={40}
/>
);
} |
Interesting... I thought they stripped out `isStatic: true`?
|
Yes, it seems that's the case. I'll update my snippet above. |
Can we close this? |
Hello , We have used following code to render contact image - But It is not displaying Contact Image. |
@supriyamalusare no clue. Please open a new issue to track. |
you just need to ask width and height to make it worked. |
in
|
Hello,
I've been trying without any success to display the thumbnail of the contact in an Image. It seems the
isStatic
prop that used to fix this in prior versions is no longer supported. Ive prefixed
file://
andfile:/
(since the first char of the returned path is/
). I'm not getting any errors, just not seeing an image. Also setting the height and width in the source object and style.Here's an example path:
/var/mobile/Containers/Data/Application/0C02FA52-38D9-485A-BA06-E9544673CB21/tmp/thumbimage_7bZzp
Thanks for any suggestions!
The text was updated successfully, but these errors were encountered: