callstack / react-native-image-editor

A library providing an API for cropping images from the web and the local file system.
MIT License
376 stars 118 forks source link

fix: Add missing ContentResolver scheme #30

Closed Sroka closed 5 years ago

Sroka commented 5 years ago

Summary

This library is using ContentProvider on Android as a mean to read image data and as such should accept all schemes handled by ContentProvider. Before this PR only URIs with file and content schemas were recognized as local URIs . This PR adds android.resource scheme what enables us to read apps resources.

Test Plan

  1. Try to read any app asset such as "android.resource:///drawable/.png"

What's required for testing (prerequisites)?

Adding some android asset to the app and trying to crop it.

What are the steps to reproduce (after prerequisites)?

  1. Try to read any app asset such as "android.resource:///drawable/.png" EX: User is able to read that asset AR: User is not able to read that asset

    Compatibility

OS Implemented
Android

Checklist

Trancever commented 5 years ago

@Sroka Awesome, thanks for PR!