File tree Expand file tree Collapse file tree 2 files changed +16
-6
lines changed
android/src/main/java/com/imageprocessingsdk Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Original file line number Diff line number Diff line change 1+ import android.content.ContentResolver
12import android.graphics.Bitmap
23import android.graphics.BitmapFactory
34import android.graphics.Matrix
45import android.media.ExifInterface
5-
6+ import android.net.Uri
7+
68object ImageUtils {
79
8- fun getBitmap (filePath : String , isMutable : Boolean ): Bitmap {
9- val exifInterface = ExifInterface (filePath)
10+ fun getBitmap (originalfilePath : String , isMutable : Boolean ): Bitmap {
11+ val uri = Uri .parse(originalfilePath)
12+ val filePath: String?
13+ val scheme = uri.scheme
14+ if (scheme != null && scheme == ContentResolver .SCHEME_CONTENT ) {
15+ filePath = uri.path
16+ } else if (scheme == null || scheme == ContentResolver .SCHEME_FILE ) {
17+ filePath= uri.path;
18+ } else {
19+ throw UnsupportedOperationException (" Unsupported scheme: " + uri.scheme)
20+ }
21+ val exifInterface = ExifInterface (filePath!! )
1022 val orientation = exifInterface.getRotationDegrees()
1123
1224 val bmpOptions = BitmapFactory .Options ()
Original file line number Diff line number Diff line change @@ -16,9 +16,7 @@ export function isImageBlurred(
1616 return new Promise ( ( resolve , reject ) => {
1717 if ( validateImageUrl ( imageUrl ) ) {
1818 if ( validateImageExtension ( imageUrl ) ) {
19- resolve (
20- ImageProcessingSDK . isImageBlurred ( imageUrl . slice ( 8 ) , blurThreshold )
21- ) ;
19+ resolve ( ImageProcessingSDK . isImageBlurred ( imageUrl , blurThreshold ) ) ;
2220 } else {
2321 reject ( new Error ( JSON . stringify ( ERROR_CODES . ERR002 ) ) ) ;
2422 }
You can’t perform that action at this time.
0 commit comments