Regression: CameraRoll.getPhotos causes StringIndexOutOfBoundsException when filename contains a # #24468
Labels
API: CameraRoll
Bug
Impact: Regression
Describes a behavior that used to work on a prior release, but stopped working recently.
Resolution: Locked
This issue was locked by the bot.
💥 Regression Report
Android only
When an image on the device has a
#
in its name,CameraRoll.getPhotos
crashes.It was introduced by this commit 54534e7
By using
URLConnection.guessContentTypeFromName
it expects any hashes to be after the extension, which then causes aStringOutOfBoundsException
hereAccording to this commit d9711e2 this issue is known but there is no fix/workaround for it.
Last working version
Worked up to version:
0.58.6
Stopped working in version:
0.59.0-rc.0
0.59.0
To Reproduce
#
in the name eg.Internal Storage/DCIM/Camera/bad#image.jpg
CameraRoll.getPhotos({first: N, assetType: 'Photos'})
withN
large enough to load the bad imageExpected Behavior
The promise resolves with the image meta-data
Code Example
Environment
info
React Native Environment Info:
System:
OS: macOS High Sierra 10.13.6
CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
Memory: 707.79 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 8.11.2 - /usr/local/bin/node
Yarn: 1.15.2 - /usr/local/bin/yarn
npm: 6.9.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
Android SDK:
API Levels: 22, 23, 24, 25, 26, 27, 28
Build Tools: 22.0.1, 26.0.1, 26.0.2, 26.0.3, 27.0.3, 28.0.0, 28.0.2, 28.0.3
System Images: android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom
IDEs:
Android Studio: 3.2 AI-181.5540.7.32.5014246
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.3 => 16.8.3
react-native: 0.59.4 => 0.59.3
npmGlobalPackages:
react-native-cli: 1.3.0
react-native-git-upgrade: 0.2.7
The text was updated successfully, but these errors were encountered: