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 34D6F19F76 for ; Mon, 11 Apr 2016 23:47:02 +0000 (UTC) Received: (qmail 51932 invoked by uid 500); 11 Apr 2016 23:47:02 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 51888 invoked by uid 500); 11 Apr 2016 23:47:01 -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 51877 invoked by uid 99); 11 Apr 2016 23:47:01 -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; Mon, 11 Apr 2016 23:47:01 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 8AB2BDFC6E; Mon, 11 Apr 2016 23:47:01 +0000 (UTC) From: riknoll To: dev@cordova.apache.org Reply-To: dev@cordova.apache.org References: In-Reply-To: Subject: [GitHub] cordova-plugin-camera pull request: Added Sample section to the Ca... Content-Type: text/plain Message-Id: <20160411234701.8AB2BDFC6E@git1-us-west.apache.org> Date: Mon, 11 Apr 2016 23:47:01 +0000 (UTC) Github user riknoll commented on a diff in the pull request: https://github.com/apache/cordova-plugin-camera/pull/203#discussion_r59300947 --- Diff: README.md --- @@ -526,3 +526,207 @@ Tizen only supports a `destinationType` of [web_activities]: https://hacks.mozilla.org/2013/01/introducing-web-activities/ [wp8_bug]: https://issues.apache.org/jira/browse/CB-2083 [msdn_wp8_docs]: http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh394006.aspx + +## Sample: Take Pictures, Select Pictures from the Picture Library, and Get Thumbnails + +The Camera plugin allows you to do things like open the device's Camera app and take a picture, or open the file picker and select one. The code snippets in this section demonstrate different tasks including: + +* Open the Camera app and take a Picture +* Take a picture and return thumbnails (resized picture) +* Take a picture and generate a FileEntry object +* Select a file from the picture library +* Select a JPEG image and return thumbnails (resized image) +* Select an image and generate a FileEntry object + +## Take a Picture + +Before you can take a picture, you need to set some Camera plugin options to pass into the Camera plugin's `getPicture` function. Here is a common set of recommendations. In this example, you create the object that you will use for the Camera options, and set the `sourceType` dynamically to support both the Camera app and the file picker. + +```js +function setOptions(srcType) { + var options = { + quality: 20, + destinationType: Camera.DestinationType.FILE_URI, + // In this app, dynamically set the picture source, Camera or photo gallery + sourceType: srcType, + encodingType: Camera.EncodingType.JPEG, + mediaType: Camera.MediaType.PICTURE, + allowEdit: true, --- End diff -- Why do we recommend this quality? I'm not arguing against it, just curious. --- 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