Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0BCA8F686 for ; Thu, 25 Apr 2013 20:44:13 +0000 (UTC) Received: (qmail 58170 invoked by uid 500); 25 Apr 2013 20:44:13 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 58134 invoked by uid 500); 25 Apr 2013 20:44:12 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@cordova.apache.org Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 58127 invoked by uid 99); 25 Apr 2013 20:44:12 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Apr 2013 20:44:12 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id AE3A3881724; Thu, 25 Apr 2013 20:44:12 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: lorinbeer@apache.org To: commits@cordova.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: ios commit: [CB-2958] simple fix, moved write to photealbum code and sourced from modified data. Photo data returned by cordova will match photo on cameraroll Date: Thu, 25 Apr 2013 20:44:12 +0000 (UTC) Updated Branches: refs/heads/master 25008a4a9 -> 3586d6cc2 [CB-2958] simple fix, moved write to photealbum code and sourced from modified data. Photo data returned by cordova will match photo on cameraroll Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/3586d6cc Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/3586d6cc Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/3586d6cc Branch: refs/heads/master Commit: 3586d6cc28d3ce3a5be5989df30d1929a2508982 Parents: 25008a4 Author: lorinbeer Authored: Thu Apr 25 13:43:27 2013 -0700 Committer: lorinbeer Committed: Thu Apr 25 13:44:04 2013 -0700 ---------------------------------------------------------------------- CordovaLib/Classes/CDVCamera.m | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/3586d6cc/CordovaLib/Classes/CDVCamera.m ---------------------------------------------------------------------- diff --git a/CordovaLib/Classes/CDVCamera.m b/CordovaLib/Classes/CDVCamera.m index b10c931..ab2e336 100644 --- a/CordovaLib/Classes/CDVCamera.m +++ b/CordovaLib/Classes/CDVCamera.m @@ -282,10 +282,6 @@ static NSSet* org_apache_cordova_validArrowDirections; image = [info objectForKey:UIImagePickerControllerOriginalImage]; } - if (cameraPicker.saveToPhotoAlbum) { - UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil); - } - if (cameraPicker.correctOrientation) { image = [self imageCorrectedForCaptureOrientation:image]; } @@ -313,6 +309,10 @@ static NSSet* org_apache_cordova_validArrowDirections; NSString* headerstring = [exifWriter createExifAPP1:[info objectForKey:@"UIImagePickerControllerMediaMetadata"]]; data = [exifWriter spliceExifBlockIntoJpeg:data withExifBlock:headerstring]; } + + if (cameraPicker.saveToPhotoAlbum) { + UIImageWriteToSavedPhotosAlbum([UIImage imageWithData:data], nil, nil, nil); + } if (cameraPicker.returnType == DestinationTypeFileUri) { // write to temp directory and return URI