[iOS] ImageResizer / Message: Image uri invalid
See original GitHub issueI use the following uri (obtained from camera):
/var/mobile/Containers/Data/Application/6DCA648B-3E9E-4535-AC2C-20AA90F17681/Library/Caches/RNRectangleScanner/O1663320548.jpeg
imageWidth and imageHeight are set properly. Rotation is set to multiples of 90 (0, 90, 180 or 270).
But when I call
createResizedImage(this.props.imageUri, imageWidth, imageHeight, 'JPEG', 100, this.state.rotation, undefined, false, {
mode: 'stretch',
onlyScaleDown: true,
})
I get the following error:

What could cause this? Why the uri is considered invalid? Same happens when I try to use a remote uri. On android it works perfectly.
"@bam.tech/react-native-image-resizer": "^3.0.0",
"react": "17.0.2",
"react-native": "0.68.2"
EDIT: I tried to add “file://” at the beginning of the uri and it did not crash anymore. But the resulted image is not as expected when rotation is different from 0. On android works perfectly also with rotation.
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:13 (2 by maintainers)
Top Results From Across the Web
Issues · bamlab/react-native-image-resizer - GitHub
Contribute to bamlab/react-native-image-resizer development by creating an account on GitHub. ... [iOS] ImageResizer / Message: Image uri invalid.
Read more >ImageResizer simply not resizing images - Stack Overflow
In the troubleshooting page for the ImageResizer, it is stated that if an image cannot be resized, it could be one of the...
Read more >Top 5 react-native-image-resizer Code Examples - Snyk
To help you get started, we've selected a few react-native-image-resizer examples, based on popular ways it is used in public projects.
Read more >react-native-image-resizer - npm
A React Native module that can create scaled versions of local images (also supports the assets library on iOS). react-native, react-native- ...
Read more >problem to load the source and recover the width and height ...
Hi,. We use this package to resize an image before sending it to a visual search engine. The source is still existing but...
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

Hi folks 👋
Indeed I introduced a regression during the migration.
I do not feel comfortable with how you access files on iOS. The difference between path, URL, etc… is not crystal clear in my mind.
I think this should help to support both path and URI : https://gist.github.com/taboulot/2a56c43dd27479c31beb2066a1f803cd
I have tested it in the example project, which uses URI, and it works well. @ggunti Can you apply this patch on your project that use path and tell me if it fixes the problem?
Updated to 3.0.4 and faced the same issue. Trying to resize photos taken with react-native-vision-camera results in an ‘Image uri invalid’ error. Image path starts with
/private/var/mobile.... Addingfile://before it fixes the issue. Is this a problem with resizer or camera?