Unable to use local tmp file path for Image.source
See original GitHub issueI am trying to use a local tmp file for the source of an Image and keep seeing error “Unrecognized tag protocol”
from the docs:
source {uri: string} uri is a string representing the resource identifier for the image, which could be an http address, a local >file path, or the name of a static image resource (which should be wrapped in the >required(‘image!name’) function).
Have tried (giving the image explicit height and width)
<Image style={styles.thumb} source={{uri:"/var/mobile/Containers/Data/Application/5938C9F8-0A9D-40DD-AB9F-CD2C772439E7/tmp/thumbimage_8gVFD"}} />
<Image style={styles.thumb} source={{uri:"file:///var/mobile/Containers/Data/Application/5938C9F8-0A9D-40DD-AB9F-CD2C772439E7/tmp/thumbimage_8gVFD"}} />
<Image style={styles.thumb} source={require("image!"+"/var/mobile/Containers/Data/Application/5938C9F8-0A9D-40DD-AB9F-CD2C772439E7/tmp/thumbimage_8gVFD"} />
Loading web assets or static image resource works just fine.
Issue Analytics
- State:
- Created 8 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
React native Unable to use local tmp file path for Image ...
The image file in your project folder and requiring it. import Logo from '..' // set image path <Image source={ ...
Read more >iOS : React native Unable to use local tmp file path for Image ...
iOS : React native Unable to use local tmp file path for Image. source iOS [ Beautify Your Computer ...
Read more >React native Unable to use local tmp file path for Image ...
The image file in your project folder and requiring it. import Logo from '..' // set image path <Image source={require(Logo)} />. Prabhu ...
Read more >"All of the possible directories for storing temporary files either ...
The Windows TEMP folder or AutoCAD temporary file folders is full. ... Excessive images have been stored up from the PDFIMPORT command.
Read more >Create a custom WorkSpaces image and bundle
All application services running on the WorkSpace must use a local system ... If you've reached this quota, new attempts to create an...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Found the answer, need to pass
isStatic
to the source of the image.I feel this should be added to the Image docs
For anyone coming here looking to solve the android file loading issue, you need to put file:// in front of your file on android