bamlab / react-native-image-resizer

🗻 Resize local images with React Native
MIT License
1.59k stars 338 forks source link

Handle file paths and URIs for internal and external storage across Android versions #404

Open ThienMD opened 2 months ago

ThienMD commented 2 months ago

This PR addresses an issue with the getOrientationMatrix method in the ImageResizer class, which did not handle file paths and URIs correctly for both internal app storage and external storage across different Android versions, especially after the introduction of Scoped Storage changes in Android 10 (API level 29).

The existing implementation had the following limitations:

  1. It did not handle internal app storage file paths correctly.
  2. It did not use the MediaStore API to retrieve content URIs for external storage file paths/URIs on Android 10 and above, as required by the Scoped Storage changes.

This PR updates the getOrientationMatrix method to handle the following scenarios:

The changes ensure that the getOrientationMatrix method works correctly for various file path/URI scenarios, taking into account the Scoped Storage changes introduced in Android 10.

stale[bot] commented 1 day ago

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.