-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Image doesn't render from local path with no extension (iOS only) #42234
Comments
|
So basically it is RN image loader issue. PS: Have not found any explanation why this was reverted. PPS: It also work for expo as |
When will this be fixed? In 0.73.3? |
I have started facing the same issue as soon as I moved to Expo SDK 50 from 48. |
This is an issue for https://github.com/polito/students-app as well: image URLs not ending with extension are NOT rendered on iOS devices only because of the lines of code @Romick2005 mentioned. |
I'm using the latest Expo SDK 50(50.0.15) with React Native(0.73.6). having a similar issue Here is an example of what my cached image URI looks like However, if I go to the caching file path and rename the file |
Just wanted to chime in that we're also seeing this issue on iOS after upgrading to Expo SDK 50 (React Native 0.73.6) from Expo SDK 49 (React Native 0.72.3). |
Has anyone found a solution for this issue? Even if the .png extension is added manually, it still doesn't work. |
Also getting this issue, downloading SHA files from a CDN with no extension, the onError shows a .png that should not be there, manually copying a file in the directory and adding a .png resolves the pathing issue, this was working previously for us on RN 69 |
I am facing this issue too. New versions need an extension, for now I have modified my code to add an extension to the file based on the response file type. |
If you are encountering issues with images not rendering on iOS when using import RNFetchBlob from 'rn-fetch-blob'
const ImageDisplayScreen = ({ imageUrl }) => {
const [imagePath, setImagePath] = useState('')
useEffect(() => {
const downloadAndDisplayImage = async () => {
const result = await RNFetchBlob.config({
fileCache: true,
appendExt: 'jpg', // Append the .jpg extension to the downloaded file
}).fetch('GET', imageUrl)
setImagePath(result.path())
}
downloadAndDisplayImage()
}, [imageUrl])
return (
<Image source={{ uri: imagePath }} />
)
} |
Description
Reason is the file has no extension name when write to path! It doesn't master under iOS, not work under React native!
Remote url Image is loaded and stored using react-native-fs and named as Z23qdxp_348:
/var/mobile/Containers/Data/Application/500161AF-8D6A-4A97-B746-0D0E12421768/Library/Caches/Z23qdxp_348
Note: If the change image name to Z23qdxp_348.jpeg the image become visible. (Works even for jpg and png image formats).
Could to be related to #23844
Steps to reproduce
https://snack.expo.dev/@romick/local-ios-image-without-extension-issue-?platform=web
React Native Version
0.73.2
Affected Platforms
Runtime - iOS
Output of
npx react-native info
info Fetching system and libraries information...
```text System: OS: macOS 14.2.1 CPU: (8) arm64 Apple M1 Memory: 79.34 MB / 16.00 GB Shell: version: "5.9" path: /bin/zsh Binaries: Node: version: 18.17.1 path: /usr/local/bin/node Yarn: version: 1.22.19 path: ~/.yarn/bin/yarn npm: version: 9.6.7 path: /usr/local/bin/npm Watchman: version: 2023.11.27.00 path: /opt/homebrew/bin/watchman Managers: CocoaPods: version: 1.14.3 path: /Users/user/.rvm/gems/ruby-3.2.1/bin/pod SDKs: iOS SDK: Platforms: - DriverKit 23.2 - iOS 17.2 - macOS 14.2 - tvOS 17.2 - watchOS 10.2 Android SDK: API Levels: - "28" - "29" - "30" - "31" - "33" - "34" Build Tools: - 28.0.3 - 29.0.2 - 29.0.3 - 30.0.2 - 30.0.3 - 31.0.0 - 33.0.0 - 33.0.1 - 34.0.0 System Images: - android-28 | Google APIs ARM 64 v8a - android-28 | Google ARM64-V8a Play ARM 64 v8a - android-31 | Google APIs ARM 64 v8a - android-32 | Google Play ARM 64 v8a - android-34 | Google Play ARM 64 v8a Android NDK: Not Found IDEs: Android Studio: 2022.3 AI-223.8836.35.2231.10811636 Xcode: version: 15.1/15C65 path: /usr/bin/xcodebuild Languages: Java: version: 17.0.9 path: /usr/bin/javac Ruby: version: 3.2.1 path: /Users/user/.rvm/rubies/ruby-3.2.1/bin/ruby npmPackages: "@react-native-community/cli": Not Found react: installed: 18.2.0 wanted: ^18.2.0 react-native: installed: 0.73.2 wanted: ^0.73.2 react-native-macos: Not Found npmGlobalPackages: "*react-native*": Not Found Android: hermesEnabled: true newArchEnabled: false iOS: hermesEnabled: true newArchEnabled: false ```Stacktrace or Logs
Reproducer
https://github.com/Liqiankun/react-native-image-no-extension
Screenshots and Videos
The text was updated successfully, but these errors were encountered: