Skip to content

Commit

Permalink
forget to add 'srcType' parameter in performCrop() function
Browse files Browse the repository at this point in the history
  • Loading branch information
EricCheung3 committed Jul 29, 2015
1 parent c975ba1 commit 4354c95
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/android/CameraLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"));
Expand Down Expand Up @@ -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);

Expand All @@ -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);
Expand Down

0 comments on commit 4354c95

Please sign in to comment.