Return-Path: X-Original-To: apmail-cordova-dev-archive@www.apache.org Delivered-To: apmail-cordova-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2FE0018A0B for ; Wed, 2 Mar 2016 16:28:01 +0000 (UTC) Received: (qmail 80076 invoked by uid 500); 2 Mar 2016 16:28:00 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 80035 invoked by uid 500); 2 Mar 2016 16:28:00 -0000 Mailing-List: contact dev-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list dev@cordova.apache.org Received: (qmail 80003 invoked by uid 99); 2 Mar 2016 16:28:00 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Mar 2016 16:28:00 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 75195E0593; Wed, 2 Mar 2016 16:28:00 +0000 (UTC) From: dieppe To: dev@cordova.apache.org Reply-To: dev@cordova.apache.org References: In-Reply-To: Subject: [GitHub] cordova-plugin-camera pull request: [iOS] Major refactor Content-Type: text/plain Message-Id: <20160302162800.75195E0593@git1-us-west.apache.org> Date: Wed, 2 Mar 2016 16:28:00 +0000 (UTC) Github user dieppe commented on a diff in the pull request: https://github.com/apache/cordova-plugin-camera/pull/185#discussion_r54748635 --- Diff: src/ios/CDVCamera.m --- @@ -402,6 +444,115 @@ - (NSString*)tempFilePath:(NSString*)extension return filePath; } +// This is not absolute, but more mightNeedOrientationCorrection +- (BOOL) needsOrientationCorrection:(UIImage*)image options:(CDVPictureOptions*)options +{ + // TODO use image to detect if it needs an orientation correction + + // See FIXME #2 + // if (options.sourceType != UIImagePickerControllerSourceTypeCamera) { + // return false; + // } + return options.correctOrientation; +} + +- (BOOL) needsResize:(CDVPictureOptions*)options +{ + return (options.targetSize.height > 0 && options.targetSize.width > 0); +} + +- (BOOL) needsEdit:(UIImage*)image options:(CDVPictureOptions*)options +{ + return [self needsOrientationCorrection:image options:options] || [self needsResize:options]; +} + +- (BOOL) needsSavingToPhotoAlbum:(UIImage*)image options:(CDVPictureOptions*)options +{ --- End diff -- It's trivial to change. Waiting for your confirmation to do so. In general, I am against duplicating images on the user's phone. But if you think it makes sense to allow it, fine by me :wink:. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org For additional commands, e-mail: dev-help@cordova.apache.org