From 4354c95c6259052b2d5234409b3e155e7522ded3 Mon Sep 17 00:00:00 2001 From: Hu Zhang Date: Tue, 28 Jul 2015 21:02:51 -0600 Subject: [PATCH] forget to add 'srcType' parameter in performCrop() function --- src/android/CameraLauncher.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/android/CameraLauncher.java b/src/android/CameraLauncher.java index cbc8f2948..2358434f7 100644 --- a/src/android/CameraLauncher.java +++ b/src/android/CameraLauncher.java @@ -314,7 +314,8 @@ public void getImage(int srcType, int returnType, int encodingType) { * * @param picUri */ - private void performCrop(Uri picUri, int destType, Intent cameraIntent) { + // TODO 0: add srcType parameter in performCrop() function + private void performCrop(Uri picUri, int srcType, int destType, Intent cameraIntent) { try { Intent cropIntent = new Intent("com.android.camera.action.CROP"); // indicate image type and Uri @@ -335,7 +336,7 @@ private void performCrop(Uri picUri, int destType, Intent cameraIntent) { } // TODO 1: - // fix the crop doesn't work on Kithat and when allowEdit=true, crop from PHOTOLIBRARY doesn't work + // fix the crop doesn't work on Kithat and when allowEdit=true, crop from PHOTOLIBRARY doesn't work on android // create new file handle to get full resolution crop if(srcType == CAMERA){ croppedUri = Uri.fromFile(new File(getTempDirectoryPath(), System.currentTimeMillis() + ".jpg")); @@ -657,7 +658,7 @@ public void onActivityResult(int requestCode, int resultCode, Intent intent) { // Because of the inability to pass through multiple intents, this hack will allow us // to pass arcane codes back. destType = requestCode - CROP_CAMERA; - // TODO 2: + // TODO 2: // process result shoud be processResultFromGallery() not processResultFromCamera() processResultFromGallery(destType, intent); @@ -679,7 +680,7 @@ else if (srcType == CAMERA) { if(this.allowEdit) { Uri tmpFile = Uri.fromFile(new File(getTempDirectoryPath(), ".Pic.jpg")); - performCrop(tmpFile, destType, intent); + performCrop(tmpFile, srcType, destType, intent); } else { this.processResultFromCamera(destType, intent);