You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by an...@apache.org on 2014/09/05 20:08:56 UTC

[01/11] git commit: Added support for the browser

Repository: cordova-plugin-camera
Updated Branches:
  refs/heads/master af566264e -> 1ffb14d76


Added support for the browser


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/commit/b2403c60
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/tree/b2403c60
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/diff/b2403c60

Branch: refs/heads/master
Commit: b2403c607652d2db21d778b39102e57652f813a8
Parents: d53a777
Author: Suraj Pindoria <su...@yahoo.com>
Authored: Fri Aug 29 15:14:41 2014 -0700
Committer: Suraj Pindoria <su...@yahoo.com>
Committed: Fri Aug 29 15:14:41 2014 -0700

----------------------------------------------------------------------
 plugin.xml                 |  13 +++++
 src/browser/CameraProxy.js | 104 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 117 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/b2403c60/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index 1bb7b57..9f3bfad 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -218,4 +218,17 @@
 
     </platform>
 
+    <!-- browser -->
+    <platform name="browser">
+        <config-file target="config.xml" parent="/*">
+            <feature name="Camera">
+                <param name="browser-package" value="Camera" />
+            </feature>
+        </config-file>
+
+        <js-module src="src/browser/CameraProxy.js" name="CameraProxy">
+            <runs />
+        </js-module>
+    </platform>
+
 </plugin>

http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/b2403c60/src/browser/CameraProxy.js
----------------------------------------------------------------------
diff --git a/src/browser/CameraProxy.js b/src/browser/CameraProxy.js
new file mode 100644
index 0000000..5756c48
--- /dev/null
+++ b/src/browser/CameraProxy.js
@@ -0,0 +1,104 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+function takePicture(success, error, opts) {
+    if (opts && opts[2] === 1) {
+        capture(success);
+    } else {
+        var input = document.createElement('input');
+        input.type = 'file';
+        input.name = 'files[]';
+
+        input.onchange = function(inputEvent) {
+            var canvas = document.createElement('canvas');
+
+            var reader = new FileReader();
+            reader.onload = function(readerEvent) {
+                input.parentNode.removeChild(input);
+
+                return success(readerEvent.target.result.replace('data:image/png;base64,', ''));
+            }
+
+            reader.readAsDataURL(inputEvent.target.files[0]);
+        };
+
+        document.body.appendChild(input);
+    }
+}
+
+function capture(success) {
+    var localMediaStream;
+
+    var video = document.createElement('video');
+    var button = document.createElement('button');
+
+    video.width = 320;
+    video.height = 240;
+    button.innerHTML = 'Capture!';
+
+    button.onclick = function() {
+        // create a canvas and capture a frame from video stream
+        var canvas = document.createElement('canvas');
+        canvas.getContext('2d').drawImage(video, 0, 0, 320, 240);
+        
+        // convert image stored in canvas to base64 encoded image
+        var imageData = canvas.toDataURL('img/png');
+        imageData = imageData.replace('data:image/png;base64,', '');
+
+        // stop video stream, remove video and button
+        localMediaStream.stop();
+        video.parentNode.removeChild(video);
+        button.parentNode.removeChild(button);
+
+        return success(imageData);
+    }
+
+    document.body.appendChild(video);
+    document.body.appendChild(button);
+
+    navigator.getUserMedia = navigator.getUserMedia ||
+                             navigator.webkitGetUserMedia ||
+                             navigator.mozGetUserMedia ||
+                             navigator.msGetUserMedia;
+
+    var successCallback = function(stream) {
+        localMediaStream = stream;
+        video.src = window.URL.createObjectURL(localMediaStream);
+        video.play();
+    }
+
+    var errorCallback = function(e) {
+        console.log('Error: ' + e);
+    }
+
+    if (navigator.getUserMedia) {
+        navigator.getUserMedia({video: true, audio: true}, successCallback, errorCallback);
+    } else {
+        alert('Browser does not support camera :(');
+    }
+}
+
+module.exports = {
+    takePicture: takePicture,
+    cleanup: function(){}
+};
+
+require("cordova/exec/proxy").add("Camera",module.exports);


[06/11] git commit: CB-7249 cordova-plugin-camera documentation translation: cordova-plugin-camera

Posted by an...@apache.org.
CB-7249 cordova-plugin-camera documentation translation: cordova-plugin-camera


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/commit/e8519609
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/tree/e8519609
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/diff/e8519609

Branch: refs/heads/master
Commit: e851960910f3fa8f9ea6b0a0efd9d931d0fceca2
Parents: ae22820
Author: Lisa Seacat DeLuca <ld...@us.ibm.com>
Authored: Thu Sep 4 22:30:08 2014 -0400
Committer: Anis Kadri <an...@apache.org>
Committed: Fri Sep 5 11:08:15 2014 -0700

----------------------------------------------------------------------
 doc/de/index.md |  46 +++++++++++++++----
 doc/es/index.md |  15 ++++--
 doc/fr/index.md |  71 +++++++++++++++++------------
 doc/it/index.md |  46 +++++++++++++++----
 doc/ja/index.md |  46 +++++++++++++++----
 doc/ko/index.md |  46 +++++++++++++++----
 doc/ru/index.md | 126 +++++++++++++++++++++++++++++----------------------
 doc/zh/index.md |  84 ++++++++++++++++++++++------------
 8 files changed, 327 insertions(+), 153 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/e8519609/doc/de/index.md
----------------------------------------------------------------------
diff --git a/doc/de/index.md b/doc/de/index.md
index fe80d32..8ba1102 100644
--- a/doc/de/index.md
+++ b/doc/de/index.md
@@ -66,6 +66,13 @@ Sie können tun, was Sie wollen, mit dem codierten Bildes oder URI, zum Beispiel
 *   Windows Phone 7 und 8
 *   Windows 8
 
+### "Einstellungen" (iOS)
+
+*   **CameraUsesGeolocation** (Boolean, Standardwert ist False). Zur Erfassung von JPEGs, auf true festgelegt, um Geolocation-Daten im EXIF-Header zu erhalten. Dies löst einen Antrag auf Geolocation-Berechtigungen, wenn auf True festgelegt.
+    
+        <preference name="CameraUsesGeolocation" value="false" />
+        
+
 ### Amazon Fire OS Macken
 
 Amazon Fire OS verwendet Absichten zum Starten von der Kamera-Aktivität auf dem Gerät, um Bilder zu erfassen und auf Handys mit wenig Speicher, Cordova Tätigkeit getötet werden kann. In diesem Szenario kann das Bild nicht angezeigt, wenn die Aktivität von Cordova wiederhergestellt wird.
@@ -141,28 +148,40 @@ Optionale Parameter die Kameraeinstellungen anpassen.
 
 *   **DestinationType**: Wählen Sie das Format des Rückgabewerts. Der Standardwert ist FILE_URI. Im Sinne `navigator.camera.DestinationType` *(Anzahl)*
     
-        Camera.DestinationType = {DATA_URL: 0, / / Return Bild als base64-codierte Zeichenfolge FILE_URI: 1, / / Return Image-Datei-URI NATIVE_URI: 2 / / Return image native URI (z. B. Ressourcen-Bibliothek: / / auf iOS oder Inhalte: / / auf Android)};
+        Camera.DestinationType = {
+            DATA_URL : 0,      // Return image as base64-encoded string
+            FILE_URI : 1,      // Return image file URI
+            NATIVE_URI : 2     // Return image native URI (e.g., assets-library:// on iOS or content:// on Android)
+        };
         
 
 *   **SourceType**: Legen Sie die Quelle des Bildes. Der Standardwert ist die Kamera. Im Sinne `navigator.camera.PictureSourceType` *(Anzahl)*
     
-        Camera.PictureSourceType = {Fotothek: 0, Kamera: 1, SAVEDPHOTOALBUM: 2};
+        Camera.PictureSourceType = {
+            PHOTOLIBRARY : 0,
+            CAMERA : 1,
+            SAVEDPHOTOALBUM : 2
+        };
         
 
 *   **AllowEdit**: einfache Bearbeitung des Bildes vor Auswahl zu ermöglichen. *(Boolesch)*
 
 *   **EncodingType**: die zurückgegebene Image-Datei ist Codierung auswählen. Standardwert ist JPEG. Im Sinne `navigator.camera.EncodingType` *(Anzahl)*
     
-        Camera.EncodingType = {JPEG: 0, / / Return JPEG-codierte Bild PNG: 1 / / Return PNG codiertes Bild};
+        Camera.EncodingType = {
+            JPEG : 0,               // Return JPEG encoded image
+            PNG : 1                 // Return PNG encoded image
+        };
         
 
 *   **TargetWidth**: Breite in Pixel zum Bild skalieren. Muss mit **TargetHeight**verwendet werden. Seitenverhältnis bleibt konstant. *(Anzahl)*
 
 *   **TargetHeight**: Höhe in Pixel zum Bild skalieren. Muss mit **TargetWidth**verwendet werden. Seitenverhältnis bleibt konstant. *(Anzahl)*
 
-*   **MediaType**: Legen Sie den Typ der Medien zur Auswahl. Funktioniert nur, wenn `PictureSourceType` ist `PHOTOLIBRARY` oder `SAVEDPHOTOALBUM` . Im Sinne `nagivator.camera.MediaType` *(Anzahl)* 
+*   **MediaType**: Legen Sie den Typ der Medien zur Auswahl. Funktioniert nur, wenn `PictureSourceType` ist `PHOTOLIBRARY` oder `SAVEDPHOTOALBUM` . Im Sinne `nagivator.camera.MediaType` *(Anzahl)*
     
-        Camera.MediaType = {Bild: 0, / / Auswahl der Standbilder nur ermöglichen. STANDARD. Will return format specified via DestinationType
+        Camera.MediaType = {
+            PICTURE: 0,    // allow selection of still pictures only. STANDARD. Will return format specified via DestinationType
             VIDEO: 1,      // allow selection of video only, WILL ALWAYS RETURN FILE_URI
             ALLMEDIA : 2   // allow selection from all media types
         };
@@ -176,10 +195,13 @@ Optionale Parameter die Kameraeinstellungen anpassen.
 
 *   **CameraDirection**: Wählen Sie die Kamera (vorn oder hinten-gerichtete) verwenden. Der Standardwert ist zurück. Im Sinne `navigator.camera.Direction` *(Anzahl)*
     
-        Camera.Direction = {zurück: 0, / / die hinten gerichteter Kamera vorne verwenden: 1 / / die nach vorn gerichtete Kamera verwenden};
+        Camera.Direction = {
+            BACK : 0,      // Use the back-facing camera
+            FRONT : 1      // Use the front-facing camera
+        };
         
 
-### Amazon Fire OSQuirks
+### Amazon Fire OS Macken
 
 *   `cameraDirection`Ergebnisse in einem hinten gerichteter Foto Wert.
 
@@ -341,9 +363,15 @@ nur iOS-Parametern, die Anker-Element Lage und Pfeil Richtung der Popover angebe
 
 *   **Höhe**: Höhe in Pixeln, das Bildschirmelement auf dem der Popover zu verankern. *(Anzahl)*
 
-*   **ArrowDir**: Richtung der Pfeil auf der Popover zeigen sollte. Im Sinne `Camera.PopoverArrowDirection` *(Anzahl)* 
+*   **ArrowDir**: Richtung der Pfeil auf der Popover zeigen sollte. Im Sinne `Camera.PopoverArrowDirection` *(Anzahl)*
     
-            Camera.PopoverArrowDirection = {ARROW_UP: 1, / / entspricht iOS UIPopoverArrowDirection Konstanten ARROW_DOWN: 2, ARROW_LEFT: 4, ARROW_RIGHT: 8, ARROW_ANY: 15};
+            Camera.PopoverArrowDirection = {
+                ARROW_UP : 1,        // matches iOS UIPopoverArrowDirection constants
+                ARROW_DOWN : 2,
+                ARROW_LEFT : 4,
+                ARROW_RIGHT : 8,
+                ARROW_ANY : 15
+            };
         
 
 Beachten Sie, dass die Größe der Popover ändern kann, um die Richtung des Pfeils und Ausrichtung des Bildschirms anzupassen. Achten Sie darauf, um Orientierung zu berücksichtigen, wenn Sie den Anker-Element-Speicherort angeben.

http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/e8519609/doc/es/index.md
----------------------------------------------------------------------
diff --git a/doc/es/index.md b/doc/es/index.md
index 8f606d4..fa02eef 100644
--- a/doc/es/index.md
+++ b/doc/es/index.md
@@ -66,6 +66,13 @@ Puedes hacer lo que quieras con la imagen codificada o URI, por ejemplo:
 *   Windows Phone 7 y 8
 *   Windows 8
 
+### Preferencias (iOS)
+
+*   **CameraUsesGeolocation** (booleano, el valor predeterminado de false). Para la captura de imágenes JPEG, establecido en true para obtener datos de geolocalización en la cabecera EXIF. Esto activará la solicitud de permisos de geolocalización si establecido en true.
+    
+        <preference name="CameraUsesGeolocation" value="false" />
+        
+
 ### Amazon fuego OS rarezas
 
 Amazon fuego OS utiliza los intentos para poner en marcha la actividad de la cámara del dispositivo para capturar imágenes y en teléfonos con poca memoria, puede matar la actividad Cordova. En este escenario, la imagen no aparezca cuando se restaura la actividad cordova.
@@ -181,7 +188,7 @@ Parámetros opcionales para personalizar la configuración de la cámara.
 
 *   **targetHeight**: altura en píxeles a escala de la imagen. Debe usarse con **targetWidth**. Proporción se mantiene constante. *(Número)*
 
-*   **mediaType**: definir el tipo de medios para seleccionar. Sólo funciona cuando `PictureSourceType` es `PHOTOLIBRARY` o `SAVEDPHOTOALBUM` . Definido en `nagivator.camera.MediaType` *(número)* 
+*   **mediaType**: definir el tipo de medios para seleccionar. Sólo funciona cuando `PictureSourceType` es `PHOTOLIBRARY` o `SAVEDPHOTOALBUM` . Definido en `nagivator.camera.MediaType` *(número)*
     
         Camera.MediaType = {
             PICTURE: 0,    // allow selection of still pictures only. DE FORMA PREDETERMINADA. Will return format specified via DestinationType
@@ -204,7 +211,7 @@ Parámetros opcionales para personalizar la configuración de la cámara.
         };
         
 
-### Amazon fuego OSQuirks
+### Amazon fuego OS rarezas
 
 *   Cualquier `cameraDirection` valor resultados en una foto orientada hacia atrás.
 
@@ -240,7 +247,7 @@ Parámetros opcionales para personalizar la configuración de la cámara.
 
 *   Ignora el `allowEdit` parámetro.
 
-*   Ignora el `PictureSourceType` parámetro (usuario elige en una ventana de diálogo)
+*   Ignora el `PictureSourceType` parámetro (el usuario lo elige en una ventana de diálogo)
 
 *   Ignora el`encodingType`
 
@@ -371,7 +378,7 @@ Sólo iOS parámetros que especifican la dirección ancla elemento ubicación y
 
 *   **altura**: alto, en píxeles, del elemento sobre el que anclar el popover pantalla. *(Número)*
 
-*   **arrowDir**: dirección de la flecha en el popover debe apuntar. Definido en `Camera.PopoverArrowDirection` *(número)* 
+*   **arrowDir**: dirección de la flecha en el popover debe apuntar. Definido en `Camera.PopoverArrowDirection` *(número)*
     
             Camera.PopoverArrowDirection = {
                 ARROW_UP : 1,        // matches iOS UIPopoverArrowDirection constants

http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/e8519609/doc/fr/index.md
----------------------------------------------------------------------
diff --git a/doc/fr/index.md b/doc/fr/index.md
index d2a06f9..5149096 100644
--- a/doc/fr/index.md
+++ b/doc/fr/index.md
@@ -66,11 +66,18 @@ Vous pouvez faire ce que vous voulez avec l'image encodée ou l'URI, par exemple
 *   Windows Phone 7 et 8
 *   Windows 8
 
+### Préférences (iOS)
+
+*   **CameraUsesGeolocation** (boolean, par défaut, false). Pour capturer des images JPEG, true pour obtenir des données de géolocalisation dans l'en-tête EXIF. Cela va déclencher une demande d'autorisations de géolocalisation si défini à true.
+    
+        <preference name="CameraUsesGeolocation" value="false" />
+        
+
 ### Amazon Fire OS Quirks
 
 Amazon Fire OS utilise des intentions pour lancer l'activité de l'appareil photo sur l'appareil pour capturer des images et sur les téléphones avec peu de mémoire, l'activité de Cordova peut être tuée. Dans ce scénario, l'image peut ne pas apparaître lorsque l'activité de cordova est restaurée.
 
-### Spécificités Android
+### Quirks Android
 
 Android utilise des intentions pour lancer l'activité de l'appareil photo sur l'appareil pour capturer des images et sur les téléphones avec peu de mémoire, l'activité de Cordova peut être tuée. Dans ce scénario, l'image peut ne pas apparaître lorsque l'activité de Cordova est restaurée.
 
@@ -87,11 +94,11 @@ Y compris un JavaScript `alert()` dans les deux le rappel fonctions peuvent caus
     setTimeout(function() {/ / votre code ici!}, 0) ;
     
 
-### Spécificités Windows Phone 7
+### Windows Phone 7 Quirks
 
 Invoquant l'application native caméra alors que l'appareil est connecté via Zune ne fonctionne pas et déclenche un rappel de l'erreur.
 
-### Spécificités Tizen
+### Bizarreries de paciarelli
 
 Paciarelli prend uniquement en charge un `destinationType` de `Camera.DestinationType.FILE_URI` et un `sourceType` de`Camera.PictureSourceType.PHOTOLIBRARY`.
 
@@ -145,14 +152,14 @@ Paramètres optionnels pour personnaliser les réglages de l'appareil.
 
 ### Options
 
-*   **quality** : Qualité de l'image enregistrée, comprise entre 0 et 100, où 100 correspond à la pleine résolution de l'appareil, sans perte liée à la compression. La valeur par défaut est 50. *(Nombre)* (Notez que les informations sur la résolution de la caméra sont indisponibles).
+*   **qualité**: qualité de l'image enregistrée, exprimée en une gamme de 0 à 100, 100 étant généralement pleine résolution sans perte de compression de fichiers. La valeur par défaut est 50. *(Nombre)* (Notez que les informations sur la résolution de la caméra sont indisponibles).
 
 *   **destinationType**: choisissez le format de la valeur de retour. La valeur par défaut est FILE_URI. Définies dans `navigator.camera.DestinationType` *(nombre)*
     
         Camera.DestinationType = {
-            DATA_URL : 0,      // Retourne l'image sous la forme d'une chaîne encodée en base-64
-            FILE_URI : 1,      // Retourne l'URI du fichier image
-            NATIVE_URI : 2     // Retourne l'URI native de l'image (ex. assets-library:// sur iOS ou content:// pour Android)
+            DATA_URL : 0,      // Return image as base64-encoded string
+            FILE_URI : 1,      // Return image file URI
+            NATIVE_URI : 2     // Return image native URI (e.g., assets-library:// on iOS or content:// on Android)
         };
         
 
@@ -165,23 +172,24 @@ Paramètres optionnels pour personnaliser les réglages de l'appareil.
         };
         
 
-*   **allowEdit**: Autoriser une modification simple de l'image avant sa sélection. *(Boolean)*
+*   **allowEdit**: permettre un montage simple d'image avant la sélection. *(Booléen)*
 
 *   **encodingType**: choisir le fichier image retournée de codage. Valeur par défaut est JPEG. Définies dans `navigator.camera.EncodingType` *(nombre)*
     
         Camera.EncodingType = {
-            JPEG : 0,               // Renvoie l'image au format JPEG
-            PNG : 1                 // Renvoie l'image au format PNG
+            JPEG : 0,               // Return JPEG encoded image
+            PNG : 1                 // Return PNG encoded image
         };
         
 
-*   **targetWidth**: largeur de sortie en pixels de l'image . Doit être utilisé avec **targetHeight**. Le ratio de l'aspect reste constant. *(Nombre)*
+*   **targetWidth**: largeur en pixels de l'image de l'échelle. Doit être utilisé avec **targetHeight**. Aspect ratio reste constant. *(Nombre)*
 
-*   **targetHeight**: hauteur de sortie en pixels de l'image. Doit être utilisé avec **targetWidth**. Aspect ratio reste constant. *(Nombre)*
+*   **targetHeight**: hauteur en pixels de l'image de l'échelle. Doit être utilisé avec **targetWidth**. Aspect ratio reste constant. *(Nombre)*
 
-*   **mediaType**: définit le type de média à choisir. Ne fonctionne que quand `PictureSourceType` vaut `PHOTOLIBRARY` ou `SAVEDPHOTOALBUM` . Définie dans `nagivator.camera.MediaType` *(nombre)* 
+*   **mediaType**: définir le type de média pour choisir de. Ne fonctionne que quand `PictureSourceType` est `PHOTOLIBRARY` ou `SAVEDPHOTOALBUM` . Définies dans `nagivator.camera.MediaType` *(nombre)*
     
-        Camera.MediaType = {photo: 0, / / permettre la sélection de photos seulement. PAR DÉFAUT. Will return format specified via DestinationType
+        Camera.MediaType = {
+            PICTURE: 0,    // allow selection of still pictures only. PAR DÉFAUT. Will return format specified via DestinationType
             VIDEO: 1,      // allow selection of video only, WILL ALWAYS RETURN FILE_URI
             ALLMEDIA : 2   // allow selection from all media types
         };
@@ -191,18 +199,21 @@ Paramètres optionnels pour personnaliser les réglages de l'appareil.
 
 *   **saveToPhotoAlbum**: enregistrer l'image sur l'album photo sur l'appareil après la capture. *(Booléen)*
 
-*   **popoverOptions**: options pour iOS uniquement qui spécifient l'emplacement de la boîte de dialogue sur iPad. Définie dans`CameraPopoverOptions`.
+*   **popoverOptions**: iOS uniquement des options qui spécifient l'emplacement de kangourou dans iPad. Défini dans`CameraPopoverOptions`.
 
 *   **cameraDirection**: choisissez la caméra à utiliser (ou dos-face). La valeur par défaut est de retour. Définies dans `navigator.camera.Direction` *(nombre)*
     
-        Camera.Direction = {BACK: 0, // utiliser la caméra arrière FRONT: 1 // utiliser la caméra frontale} ;
+        Camera.Direction = {
+            BACK : 0,      // Use the back-facing camera
+            FRONT : 1      // Use the front-facing camera
+        };
         
 
-### Amazon Fire OSQuirks
+### Amazon Fire OS Quirks
 
 *   Tout `cameraDirection` résultats dans le back-face photo de valeur.
 
-*   Ignore le paramètre `allowEdit`.
+*   Ignore la `allowEdit` paramètre.
 
 *   `Camera.PictureSourceType.PHOTOLIBRARY`et `Camera.PictureSourceType.SAVEDPHOTOALBUM` les deux affichent le même album photo.
 
@@ -216,7 +227,7 @@ Paramètres optionnels pour personnaliser les réglages de l'appareil.
 
 ### BlackBerry 10 Quirks
 
-*   Ignore le paramètre `quality`.
+*   Ignore la `quality` paramètre.
 
 *   Ignore la `allowEdit` paramètre.
 
@@ -248,7 +259,7 @@ Paramètres optionnels pour personnaliser les réglages de l'appareil.
 
 ### iOS Quirks
 
-*   Choisir la valeur `quality` en dessous de 50 pour éviter les erreurs de mémoire sur certains appareils.
+*   La valeur `quality` inférieur à 50 pour éviter les erreurs de mémoire sur certains appareils.
 
 *   Lorsque vous utilisez `destinationType.FILE_URI` , les photos sont sauvegardées dans le répertoire temporaire de l'application. Le contenu du répertoire temporaire de l'application est supprimé lorsque l'application se termine.
 
@@ -283,7 +294,7 @@ fonction de rappel onError qui fournit un message d'erreur.
 
 ### Paramètres
 
-*   **message** : le message est fourni par du code natif de l'appareil. *(String)*
+*   **message**: le message est fourni par du code natif de l'appareil. *(String)*
 
 ## cameraSuccess
 
@@ -296,7 +307,7 @@ fonction de rappel onSuccess qui fournit les données d'image.
 
 ### Paramètres
 
-*   **imageData**: codage Base64 de l'image, *ou* le fichier image URI, selon `cameraOptions` utilisé. *(String)*
+*   **imageData**: codage Base64 de l'image, *ou* le fichier image URI, selon `cameraOptions` en vigueur. *(String)*
 
 ### Exemple
 
@@ -314,7 +325,7 @@ Un handle vers la boîte de dialogue de kangourou créé par`navigator.camera.ge
 
 ### Méthodes
 
-*   **setPosition**: Définit la position de la boite de dialogue.
+*   **setPosition**: définir la position de la kangourou.
 
 ### Plates-formes prises en charge
 
@@ -326,7 +337,7 @@ Définir la position de la kangourou.
 
 **Paramètres**:
 
-*   `cameraPopoverOptions`: l'objet `CameraPopoverOptions` spécifiant la nouvelle position
+*   `cameraPopoverOptions`: la `CameraPopoverOptions` qui spécifie la nouvelle position
 
 ### Exemple
 
@@ -352,18 +363,18 @@ iOS uniquement les paramètres qui spécifient la direction ancre élément empl
 
 ### CameraPopoverOptions
 
-*   **x**: coordonnée en x (pixels) de l'élément à l'écran sur lequel accrocher la boite de dialogue. *(Number)*
+*   **x**: coordonnée de pixel de l'élément de l'écran sur lequel ancrer le kangourou x. *(Nombre)*
 
-*   **y**: coordonnée en y (pixels) de l'élément à l'écran sur lequel accrocher la boite de dialogue. *(Number)*
+*   **y**: coordonnée de y pixels de l'élément de l'écran sur lequel ancrer le kangourou. *(Nombre)*
 
-*   **width**: largeur en pixels de l'élément à l'écran sur lequel accrocher la boite de dialogue. *(Number)*
+*   **largeur**: largeur, en pixels, de l'élément de l'écran sur lequel ancrer le kangourou. *(Nombre)*
 
-*   **height**: hauteur en pixels de l'élément à l'écran sur lequel accrocher la boite de dialogue. *(Number)*
+*   **hauteur**: hauteur, en pixels, de l'élément de l'écran sur lequel ancrer le kangourou. *(Nombre)*
 
-*   **arrowDir**: Direction vers laquelle la flèche de la boîte de dialogue doit pointer. Définie dans `Camera.PopoverArrowDirection` *(Number)*
+*   **arrowDir**: Direction de la flèche sur le kangourou doit pointer. Définies dans `Camera.PopoverArrowDirection` *(nombre)*
     
             Camera.PopoverArrowDirection = {
-                ARROW_UP : 1,        // correspondent aux constantes iOS UIPopoverArrowDirection
+                ARROW_UP : 1,        // matches iOS UIPopoverArrowDirection constants
                 ARROW_DOWN : 2,
                 ARROW_LEFT : 4,
                 ARROW_RIGHT : 8,

http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/e8519609/doc/it/index.md
----------------------------------------------------------------------
diff --git a/doc/it/index.md b/doc/it/index.md
index 9186a2d..1ee48f2 100644
--- a/doc/it/index.md
+++ b/doc/it/index.md
@@ -66,6 +66,13 @@ Si può fare quello che vuoi con l'immagine codificata o URI, ad esempio:
 *   Windows Phone 7 e 8
 *   Windows 8
 
+### Preferenze (iOS)
+
+*   **CameraUsesGeolocation** (boolean, default è false). Per l'acquisizione di immagini JPEG, impostato su true per ottenere dati di geolocalizzazione nell'intestazione EXIF. Questo innescherà una richiesta per le autorizzazioni di geolocalizzazione, se impostato su true.
+    
+        <preference name="CameraUsesGeolocation" value="false" />
+        
+
 ### Amazon fuoco OS stranezze
 
 Amazon fuoco OS utilizza intenti a lanciare l'attività della fotocamera sul dispositivo per catturare immagini e sui telefoni con poca memoria, l'attività di Cordova può essere ucciso. In questo scenario, l'immagine potrebbe non apparire quando viene ripristinata l'attività di cordova.
@@ -141,28 +148,40 @@ Parametri opzionali per personalizzare le impostazioni della fotocamera.
 
 *   **destinationType**: Scegli il formato del valore restituito. Il valore predefinito è FILE_URI. Definito in `navigator.camera.DestinationType` *(numero)*
     
-        Camera.DestinationType = {DATA_URL: 0, / / ritorno di immagine come stringa con codifica base64 FILE_URI: 1, / / ritorno file immagine URI NATIVE_URI: 2 / / ritorno immagine nativa URI (ad esempio, beni-biblioteca: / / su iOS o contenuto: / / su Android)};
+        Camera.DestinationType = {
+            DATA_URL : 0,      // Return image as base64-encoded string
+            FILE_URI : 1,      // Return image file URI
+            NATIVE_URI : 2     // Return image native URI (e.g., assets-library:// on iOS or content:// on Android)
+        };
         
 
 *   **sourceType**: impostare l'origine dell'immagine. Il valore predefinito è la fotocamera. Definito in `navigator.camera.PictureSourceType` *(numero)*
     
-        Camera.PictureSourceType = {PHOTOLIBRARY: 0, fotocamera: 1, SAVEDPHOTOALBUM: 2};
+        Camera.PictureSourceType = {
+            PHOTOLIBRARY : 0,
+            CAMERA : 1,
+            SAVEDPHOTOALBUM : 2
+        };
         
 
 *   **Proprietà allowEdit**: consentire la semplice modifica dell'immagine prima di selezione. *(Booleano)*
 
 *   **encodingType**: scegliere il file immagine restituita di codifica. Predefinito è JPEG. Definito in `navigator.camera.EncodingType` *(numero)*
     
-        Camera.EncodingType = {JPEG: 0, / / JPEG restituire codificati immagine PNG: 1 / / ritorno PNG codificato immagine};
+        Camera.EncodingType = {
+            JPEG : 0,               // Return JPEG encoded image
+            PNG : 1                 // Return PNG encoded image
+        };
         
 
 *   **targetWidth**: larghezza in pixel all'immagine della scala. Deve essere usato con **targetHeight**. Proporzioni rimane costante. *(Numero)*
 
 *   **targetHeight**: altezza in pixel all'immagine della scala. Deve essere usato con **targetWidth**. Proporzioni rimane costante. *(Numero)*
 
-*   **mediaType**: impostare il tipo di supporto per scegliere da. Funziona solo quando `PictureSourceType` è `PHOTOLIBRARY` o `SAVEDPHOTOALBUM` . Definito in `nagivator.camera.MediaType` *(numero)* 
+*   **mediaType**: impostare il tipo di supporto per scegliere da. Funziona solo quando `PictureSourceType` è `PHOTOLIBRARY` o `SAVEDPHOTOALBUM` . Definito in `nagivator.camera.MediaType` *(numero)*
     
-        Camera.MediaType = {foto: 0, / / permette la selezione di immagini ancora solo. PER IMPOSTAZIONE PREDEFINITA. Will return format specified via DestinationType
+        Camera.MediaType = {
+            PICTURE: 0,    // allow selection of still pictures only. PER IMPOSTAZIONE PREDEFINITA. Will return format specified via DestinationType
             VIDEO: 1,      // allow selection of video only, WILL ALWAYS RETURN FILE_URI
             ALLMEDIA : 2   // allow selection from all media types
         };
@@ -176,10 +195,13 @@ Parametri opzionali per personalizzare le impostazioni della fotocamera.
 
 *   **cameraDirection**: scegliere la telecamera da utilizzare (o retro-frontale). Il valore predefinito è tornato. Definito in `navigator.camera.Direction` *(numero)*
     
-        Camera.Direction = {indietro: 0, / / utilizzare la fotocamera posteriore anteriore: 1 / / utilizzare la fotocamera frontale};
+        Camera.Direction = {
+            BACK : 0,      // Use the back-facing camera
+            FRONT : 1      // Use the front-facing camera
+        };
         
 
-### Amazon Fire OSQuirks
+### Amazon fuoco OS stranezze
 
 *   Qualsiasi `cameraDirection` valore i risultati in una foto di lamatura.
 
@@ -341,9 +363,15 @@ iOS solo parametri che specificano l'ancoraggio elemento posizione e freccia dir
 
 *   **altezza**: altezza, in pixel, dell'elemento dello schermo su cui ancorare il muffin. *(Numero)*
 
-*   **arrowDir**: direzione dovrebbe puntare la freccia il muffin. Definito in `Camera.PopoverArrowDirection` *(numero)* 
+*   **arrowDir**: direzione dovrebbe puntare la freccia il muffin. Definito in `Camera.PopoverArrowDirection` *(numero)*
     
-            Camera.PopoverArrowDirection = {ARROW_UP: 1, / / corrisponde a iOS UIPopoverArrowDirection costanti ARROW_DOWN: 2, ARROW_LEFT: 4, ARROW_RIGHT: 8, ARROW_ANY: 15};
+            Camera.PopoverArrowDirection = {
+                ARROW_UP : 1,        // matches iOS UIPopoverArrowDirection constants
+                ARROW_DOWN : 2,
+                ARROW_LEFT : 4,
+                ARROW_RIGHT : 8,
+                ARROW_ANY : 15
+            };
         
 
 Si noti che la dimensione del muffin possa cambiare per regolare la direzione della freccia e l'orientamento dello schermo. Assicurarsi che tenere conto di modifiche di orientamento quando si specifica la posizione di elemento di ancoraggio.

http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/e8519609/doc/ja/index.md
----------------------------------------------------------------------
diff --git a/doc/ja/index.md b/doc/ja/index.md
index 8e6aff2..ffa30ef 100644
--- a/doc/ja/index.md
+++ b/doc/ja/index.md
@@ -66,6 +66,13 @@
 *   Windows Phone 7 と 8
 *   Windows 8
 
+### 環境設定 (iOS)
+
+*   **CameraUsesGeolocation**(ブール値、デフォルトは false)。 Jpeg 画像をキャプチャするため EXIF ヘッダーで地理位置情報データを取得する場合は true に設定します。 これは、場合地理位置情報のアクセス許可に対する要求をトリガーする true に設定します。
+    
+        <preference name="CameraUsesGeolocation" value="false" />
+        
+
 ### アマゾン火 OS 癖
 
 アマゾン火 OS イメージをキャプチャするデバイス上のカメラの活動を開始する意図を使用して、メモリの少ない携帯電話、コルドバ活動が殺されるかもしれない。 このシナリオでは、コルドバの活動が復元されるとき、画像が表示されません。
@@ -141,28 +148,40 @@ Tizen のみをサポートしている、 `destinationType` の `Camera.Destina
 
 *   **destinationType**: 戻り値の形式を選択します。既定値は FILE_URI です。定義されている `navigator.camera.DestinationType` *(番号)*
     
-        Camera.DestinationType = {DATA_URL: 0、/base64 エンコード文字列 FILE_URI としてイメージを返す/: 1、//画像ファイル URI NATIVE_URI を返す: 2//戻り画像ネイティブ URI (例えば、資産ライブラリ://iOS またはコンテンツに://アンドロイド)};
+        Camera.DestinationType = {
+            DATA_URL : 0,      // Return image as base64-encoded string
+            FILE_URI : 1,      // Return image file URI
+            NATIVE_URI : 2     // Return image native URI (e.g., assets-library:// on iOS or content:// on Android)
+        };
         
 
 *   **sourceType**: 画像のソースを設定します。既定値は、カメラです。定義されている `navigator.camera.PictureSourceType` *(番号)*
     
-        Camera.PictureSourceType = {フォト ライブラリ: 0, カメラ: 1、SAVEDPHOTOALBUM: 2};
+        Camera.PictureSourceType = {
+            PHOTOLIBRARY : 0,
+            CAMERA : 1,
+            SAVEDPHOTOALBUM : 2
+        };
         
 
 *   **allowEdit**: 単純な選択の前に画像の編集を許可します。*(ブール値)*
 
 *   **encodingType**: 返されるイメージ ファイルのエンコーディングを選択します。デフォルトは JPEG です。定義されている `navigator.camera.EncodingType` *(番号)*
     
-        Camera.EncodingType = {JPEG: 0//戻る JPEG PNG イメージをエンコード: 1/返す PNG イメージをエンコードされた/};
+        Camera.EncodingType = {
+            JPEG : 0,               // Return JPEG encoded image
+            PNG : 1                 // Return PNG encoded image
+        };
         
 
 *   **targetWidth**: スケール イメージにピクセル単位の幅。**TargetHeight**を使用する必要があります。縦横比は変わりません。*(数)*
 
 *   **targetHeight**: スケール イメージにピクセル単位の高さ。**TargetWidth**を使用する必要があります。縦横比は変わりません。*(数)*
 
-*   **mediaType**: から選択するメディアの種類を設定します。 場合にのみ働きます `PictureSourceType` は `PHOTOLIBRARY` または `SAVEDPHOTOALBUM` 。 定義されている `nagivator.camera.MediaType` *(番号)* 
+*   **mediaType**: から選択するメディアの種類を設定します。 場合にのみ働きます `PictureSourceType` は `PHOTOLIBRARY` または `SAVEDPHOTOALBUM` 。 定義されている `nagivator.camera.MediaType` *(番号)*
     
-        Camera.MediaType = {画像: 0//静止画のみを選択できます。 既定値です。 Will return format specified via DestinationType
+        Camera.MediaType = {
+            PICTURE: 0,    // allow selection of still pictures only. 既定値です。 Will return format specified via DestinationType
             VIDEO: 1,      // allow selection of video only, WILL ALWAYS RETURN FILE_URI
             ALLMEDIA : 2   // allow selection from all media types
         };
@@ -176,10 +195,13 @@ Tizen のみをサポートしている、 `destinationType` の `Camera.Destina
 
 *   **cameraDirection**: (前面または背面側) を使用するカメラを選択します。既定値は戻るです。定義されている `navigator.camera.Direction` *(番号)*
     
-        Camera.Direction = {戻る: 0、//後ろ向きカメラ前部を使用: 1/フロントに面したカメラを使用して/};
+        Camera.Direction = {
+            BACK : 0,      // Use the back-facing camera
+            FRONT : 1      // Use the front-facing camera
+        };
         
 
-### アマゾン火 OSQuirks
+### アマゾン火 OS 癖
 
 *   任意 `cameraDirection` 背面写真で結果の値します。
 
@@ -341,9 +363,15 @@ iOS だけ指定パラメーターをポップ オーバーのアンカー要素
 
 *   **高さ**: ポップ オーバーのアンカーになる上の画面要素のピクセル単位の高さ。*(数)*
 
-*   **arrowDir**: 方向のポップ オーバーで矢印をポイントする必要があります。定義されている `Camera.PopoverArrowDirection` *(番号)* 
+*   **arrowDir**: 方向のポップ オーバーで矢印をポイントする必要があります。定義されている `Camera.PopoverArrowDirection` *(番号)*
     
-            Camera.PopoverArrowDirection = {ARROW_UP: 1、/iOS UIPopoverArrowDirection 定数 ARROW_DOWN と一致する/: 2、ARROW_LEFT: 4、ARROW_RIGHT: 8、ARROW_ANY: 15};
+            Camera.PopoverArrowDirection = {
+                ARROW_UP : 1,        // matches iOS UIPopoverArrowDirection constants
+                ARROW_DOWN : 2,
+                ARROW_LEFT : 4,
+                ARROW_RIGHT : 8,
+                ARROW_ANY : 15
+            };
         
 
 矢印の方向と、画面の向きを調整するポップ オーバーのサイズを変更可能性がありますに注意してください。 アンカー要素の位置を指定するときの方向の変化を考慮することを確認します。

http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/e8519609/doc/ko/index.md
----------------------------------------------------------------------
diff --git a/doc/ko/index.md b/doc/ko/index.md
index 4ec33e8..d65fcef 100644
--- a/doc/ko/index.md
+++ b/doc/ko/index.md
@@ -66,6 +66,13 @@
 *   Windows Phone 7과 8
 *   윈도우 8
 
+### 환경 설정 (iOS)
+
+*   **CameraUsesGeolocation** (boolean, 기본값: false)입니다. 캡처 Jpeg, EXIF 헤더에 지리적 데이터를 true로 설정 합니다. 이 경우 위치 정보 사용 권한에 대 한 요청을 일으킬 것 이다 true로 설정 합니다.
+    
+        <preference name="CameraUsesGeolocation" value="false" />
+        
+
 ### 아마존 화재 OS 단점
 
 아마존 화재 OS 의도 사용 하 여 이미지 캡처 장치에서 카메라 활동을 시작 하 고 낮은 메모리와 휴대 전화에 코르 도우 바 활동 살해 수 있습니다. 코르도바 활동 복원 되 면이 시나리오에서는 이미지가 나타나지 않을 수 있습니다.
@@ -141,28 +148,40 @@ Tizen만 지원 한 `destinationType` 의 `Camera.DestinationType.FILE_URI` 와
 
 *   **destinationType**: 반환 값의 형식을 선택 합니다. 기본값은 FILE_URI입니다. 에 정의 된 `navigator.camera.DestinationType` *(수)*
     
-        Camera.DestinationType = {DATA_URL: 0, / / base64 인코딩된 문자열로 FILE_URI 이미지를 반환: 1, / / 이미지 파일 URI NATIVE_URI 반환: 2 / / 반환 이미지 기본 URI (예를 들어, 자산 라이브러리: / / iOS 또는 콘텐츠: / / 안 드 로이드에)};
+        Camera.DestinationType = {
+            DATA_URL : 0,      // Return image as base64-encoded string
+            FILE_URI : 1,      // Return image file URI
+            NATIVE_URI : 2     // Return image native URI (e.g., assets-library:// on iOS or content:// on Android)
+        };
         
 
 *   **sourceType**: 그림의 소스를 설정 합니다. 기본값은 카메라입니다. 에 정의 된 `navigator.camera.PictureSourceType` *(수)*
     
-        Camera.PictureSourceType = {PHOTOLIBRARY: 0, 카메라: 1, SAVEDPHOTOALBUM: 2};
+        Camera.PictureSourceType = {
+            PHOTOLIBRARY : 0,
+            CAMERA : 1,
+            SAVEDPHOTOALBUM : 2
+        };
         
 
 *   **allowEdit**: 선택 하기 전에 이미지의 간단한 편집을 허용 합니다. *(부울)*
 
 *   **encodingType**: 반환 된 이미지 파일의 인코딩을 선택 합니다. 기본값은 JPEG입니다. 에 정의 된 `navigator.camera.EncodingType` *(수)*
     
-        Camera.EncodingType = {JPEG: 0, / / 반환 JPEG로 인코딩된 PNG 이미지: 1 / 반환 PNG 이미지 인코딩 /};
+        Camera.EncodingType = {
+            JPEG : 0,               // Return JPEG encoded image
+            PNG : 1                 // Return PNG encoded image
+        };
         
 
 *   **targetWidth**: 스케일 이미지를 픽셀 너비. **TargetHeight**와 함께 사용 해야 합니다. 가로 세로 비율이 일정 하 게 유지 합니다. *(수)*
 
 *   **targetHeight**: 스케일 이미지를 픽셀 단위로 높이. **TargetWidth**와 함께 사용 해야 합니다. 가로 세로 비율이 일정 하 게 유지 합니다. *(수)*
 
-*   **mediaType**:에서 선택 미디어 유형을 설정 합니다. 때에 작동 `PictureSourceType` 는 `PHOTOLIBRARY` 또는 `SAVEDPHOTOALBUM` . 에 정의 된 `nagivator.camera.MediaType` *(수)* 
+*   **mediaType**:에서 선택 미디어 유형을 설정 합니다. 때에 작동 `PictureSourceType` 는 `PHOTOLIBRARY` 또는 `SAVEDPHOTOALBUM` . 에 정의 된 `nagivator.camera.MediaType` *(수)*
     
-        Camera.MediaType = {그림: 0, / / 아직 사진만의 선택을 허용 합니다. 기본입니다. Will return format specified via DestinationType
+        Camera.MediaType = {
+            PICTURE: 0,    // allow selection of still pictures only. 기본입니다. Will return format specified via DestinationType
             VIDEO: 1,      // allow selection of video only, WILL ALWAYS RETURN FILE_URI
             ALLMEDIA : 2   // allow selection from all media types
         };
@@ -176,10 +195,13 @@ Tizen만 지원 한 `destinationType` 의 `Camera.DestinationType.FILE_URI` 와
 
 *   **cameraDirection**: (앞 이나 뒤로-연결)를 사용 하 여 카메라를 선택 하십시오. 기본값은 다시. 에 정의 된 `navigator.camera.Direction` *(수)*
     
-        Camera.Direction = {다시: 0, / / 앞 뒤 방향 카메라를 사용: 1 / 전면을 향하는 카메라를 사용 하 여 /};
+        Camera.Direction = {
+            BACK : 0,      // Use the back-facing camera
+            FRONT : 1      // Use the front-facing camera
+        };
         
 
-### 아마존 화재 OSQuirks
+### 아마존 화재 OS 단점
 
 *   어떤 `cameraDirection` 다시 연결 사진에 결과 값.
 
@@ -341,9 +363,15 @@ iOS 전용 매개 변수 iPad의 보관 함 또는 앨범에서 이미지를 선
 
 *   **높이**: 높이 (픽셀)는 popover 앵커는 화면 요소. *(수)*
 
-*   **arrowDir**: 방향 화살표는 popover 가리켜야 합니다. 에 정의 된 `Camera.PopoverArrowDirection` *(수)* 
+*   **arrowDir**: 방향 화살표는 popover 가리켜야 합니다. 에 정의 된 `Camera.PopoverArrowDirection` *(수)*
     
-            Camera.PopoverArrowDirection = {ARROW_UP: 1, / / iOS UIPopoverArrowDirection 상수 ARROW_DOWN 일치: 2, ARROW_LEFT: 4, ARROW_RIGHT: 8, ARROW_ANY: 15};
+            Camera.PopoverArrowDirection = {
+                ARROW_UP : 1,        // matches iOS UIPopoverArrowDirection constants
+                ARROW_DOWN : 2,
+                ARROW_LEFT : 4,
+                ARROW_RIGHT : 8,
+                ARROW_ANY : 15
+            };
         
 
 참고는 popover의 크기 조정 화살표 방향 및 화면 방향 변경 될 수 있습니다. 앵커 요소 위치를 지정 하는 경우 방향 변경에 대 한 계정에 있는지 확인 합니다.

http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/e8519609/doc/ru/index.md
----------------------------------------------------------------------
diff --git a/doc/ru/index.md b/doc/ru/index.md
index a1a17fd..fd74eb8 100644
--- a/doc/ru/index.md
+++ b/doc/ru/index.md
@@ -66,32 +66,39 @@
 *   Windows Phone 7 и 8
 *   Windows 8
 
-### Особенности Amazon Fire OS
+### Предпочтения (iOS)
+
+*   **CameraUsesGeolocation** (логическое значение, по умолчанию false). Для захвата изображения JPEG, значение true, чтобы получить данные геопозиционирования в заголовке EXIF. Это вызовет запрос на разрешения геолокации, если задано значение true.
+    
+        <preference name="CameraUsesGeolocation" value="false" />
+        
+
+### Amazon Fire OS причуды
 
 Amazon Fire OS используют намерения для запуска активности камеры на устройстве для съемки фотографий, и на устройствах с низким объемам памяти, активность Cordova может быть завершена. В этом случае изображение может не появиться при восстановлении активности Cordova.
 
-### Особенности Android
+### Android причуды
 
 Android использует намерения начать действие камеры на устройстве для захвата изображения, и на телефонах с низкой памяти, могут быть убиты Cordova деятельность. В этом случае изображение не может появиться, когда Кордова активность восстанавливается.
 
-### Особенности Firefox OS
+### Firefox OS причуды
 
 Модуль камеры в настоящее время реализуется с помощью [Веб деятельности][2].
 
  [2]: https://hacks.mozilla.org/2013/01/introducing-web-activities/
 
-### Особенности iOS
+### iOS причуды
 
 Включая JavaScript `alert()` в любом из обратного вызова функции может вызвать проблемы. Оберните оповещение в `setTimeout()` выбора изображений iOS или пирог полностью закрыть прежде чем отображает оповещения:
 
     setTimeout(function() {/ / ваши вещи!}, 0);
     
 
-### Особенности Windows Phone 7
+### Windows Phone 7 причуды
 
 Вызов приложения родной камеры, в то время как устройство подключается через Zune не работает и инициирует обратный вызов для ошибки.
 
-### Особенности Tizen
+### Причуды Tizen
 
 Tizen поддерживает только `destinationType` из `Camera.DestinationType.FILE_URI` и `sourceType` из`Camera.PictureSourceType.PHOTOLIBRARY`.
 
@@ -145,77 +152,80 @@ Tizen поддерживает только `destinationType` из `Camera.Desti
 
 ### Параметры
 
-*   **quality**: качество сохраняемого изображения, выражается в виде числа в диапазоне от 0 до 100, где 100 является обычно полным изображением без потери качества при сжатии. Значение по умолчанию — 50. *(Число)* (Обратите внимание, что информация о разрешение камеры недоступна.)
+*   **качество**: качество сохраняемого изображения, выражается в виде диапазона 0-100, где 100 является обычно полным разрешением без потери от сжатия файлов. Значение по умолчанию — 50. *(Число)* (Обратите внимание, что информация о разрешение камеры недоступна.)
 
 *   **параметр destinationType**: выберите формат возвращаемого значения. Значение по умолчанию — FILE_URI. Определяется в `navigator.camera.DestinationType` *(число)*
     
         Camera.DestinationType = {
-        DATA_URL: 0, / / возвращение изображения в base64-кодировке строки 
-        FILE_URI: 1, / / возврат файла изображения URI 
-        NATIVE_URI: 2 / / возвращение образа собственного URI (например, Библиотека активов: / / на iOS или содержание: / / на андроиде)
+            DATA_URL : 0,      // Return image as base64-encoded string
+            FILE_URI : 1,      // Return image file URI
+            NATIVE_URI : 2     // Return image native URI (e.g., assets-library:// on iOS or content:// on Android)
         };
         
 
 *   **тип источника**: установить источник рисунка. По умолчанию используется камера. Определяется в `navigator.camera.PictureSourceType` *(число)*
     
         Camera.PictureSourceType = {
-        PHOTOLIBRARY: 0, 
-        CAMERA: 1, 
-        SAVEDPHOTOALBUM: 2
+            PHOTOLIBRARY : 0,
+            CAMERA : 1,
+            SAVEDPHOTOALBUM : 2
         };
         
 
-*   **allowEdit**: позволит редактирование изображения средствами телефона перед окончательным выбором изображения. *(Логический)*
+*   **allowEdit**: позволяют простое редактирование изображения перед выбором. *(Логическое)*
 
 *   **Тип_шифрования**: выберите возвращенный файл в кодировку. Значение по умолчанию — JPEG. Определяется в `navigator.camera.EncodingType` *(число)*
     
         Camera.EncodingType = {
-        JPEG: 0, // возвращает изображение в формате JPEG
-        PNG: 1 // возвращает рисунок в формате PNG
+            JPEG : 0,               // Return JPEG encoded image
+            PNG : 1                 // Return PNG encoded image
         };
         
 
-*   **targetWidth**: ширина изображения в пикселах к которой необходимо осуществить масштабирование. Это значение должно использоваться совместно с **targetHeight**. Пропорции изображения останутся неизменными. *(Число)*
+*   **targetWidth**: ширина до масштаба изображения в пикселях. Должен использоваться с **targetHeight**. Соотношение остается неизменным. *(Число)*
 
-*   **targetHeight**: высота изображения в пикселах к которой необходимо осуществить масштабирование. Это значение должно использоваться совместно с **targetWidth**. Пропорции изображения останутся неизменными. *(Число)*
+*   **targetHeight**: высота до масштаба изображения в пикселях. Должен использоваться с **targetWidth**. Соотношение остается неизменным. *(Число)*
 
-*   **mediaType**: Установите источник получения изображения, из которого надо выбрать изображение. Работает только если `PictureSourceType` равно `PHOTOLIBRARY` или `SAVEDPHOTOALBUM` . Определено в `nagivator.camera.MediaType` *(число)* 
+*   **тип носителя**: задать тип носителя, чтобы выбрать из. Работает только если `PictureSourceType` является `PHOTOLIBRARY` или `SAVEDPHOTOALBUM` . Определяется в `nagivator.camera.MediaType` *(число)*
     
         Camera.MediaType = {
-        PICTURE: 0, / / разрешить выбор только сохраненных изображений. DEFAULT. Will return format specified via DestinationType
+            PICTURE: 0,    // allow selection of still pictures only. ПО УМОЛЧАНИЮ. Will return format specified via DestinationType
             VIDEO: 1,      // allow selection of video only, WILL ALWAYS RETURN FILE_URI
             ALLMEDIA : 2   // allow selection from all media types
         };
         
 
-*   **correctOrientation**: вращает изображение, чтобы внести исправления к ориентации устройства во время захвата. *(Логический)*
+*   **correctOrientation**: поворот изображения исправить для ориентации устройства во время захвата. *(Логическое)*
 
-*   **saveToPhotoAlbum**: сохранить изображение в фотоальбом на устройстве после захвата. *(Логический)*
+*   **saveToPhotoAlbum**: сохранить изображение в фотоальбом на устройстве после захвата. *(Логическое)*
 
 *   **popoverOptions**: только для iOS параметры, которые определяют местоположение инструмента в iPad. Определены в`CameraPopoverOptions`.
 
 *   **cameraDirection**: выбрать камеру для использования (передней или задней стороне). Значение по умолчанию — обратно. Определяется в `navigator.camera.Direction` *(число)*
     
-        Camera.Direction = {обратно: 0, / / использовать обратно, стоящих перед камерой фронт: 1 / / использовать фронтальная камера};
+        Camera.Direction = {
+            BACK : 0,      // Use the back-facing camera
+            FRONT : 1      // Use the front-facing camera
+        };
         
 
-### Особенности Amazon Fire OS
+### Amazon Fire OS причуды
 
-*   Любое значение `cameraDirection` возвращает фотографию сделанную задней камерой.
+*   Любой `cameraDirection` значение результатов на задней стороне фотографии.
 
-*   Игнорирует `allowEdit` параметр.
+*   Игнорирует параметр `allowEdit`.
 
-*   `Camera.PictureSourceType.PHOTOLIBRARY`и `Camera.PictureSourceType.SAVEDPHOTOALBUM` оба отображения же фотоальбом.
+*   Оба параметра `Camera.PictureSourceType.PHOTOLIBRARY` и `Camera.PictureSourceType.SAVEDPHOTOALBUM` отображают один и тот же фотоальбом.
 
 ### Android причуды
 
 *   Любой `cameraDirection` значение результатов на задней стороне фотографии.
 
-*   Игнорирует параметр `allowEdit`.
+*   Игнорирует `allowEdit` параметр.
 
-*   Оба параметра `Camera.PictureSourceType.PHOTOLIBRARY` и `Camera.PictureSourceType.SAVEDPHOTOALBUM` отображают один и тот же фотоальбом.
+*   `Camera.PictureSourceType.PHOTOLIBRARY`и `Camera.PictureSourceType.SAVEDPHOTOALBUM` как отображение же фотоальбом.
 
-### Особенности BlackBerry 10
+### Причуды blackBerry 10
 
 *   Игнорирует `quality` параметр.
 
@@ -231,41 +241,41 @@ Tizen поддерживает только `destinationType` из `Camera.Desti
 
 *   Игнорирует `quality` параметр.
 
-*   Значение `Camera.DestinationType` игнорируется и равно `1` (URI для файла изображения)
+*   `Camera.DestinationType`игнорируется и равен `1` (URI файла изображения)
 
-*   Игнорирует параметр `allowEdit`.
+*   Игнорирует `allowEdit` параметр.
 
-*   Игнорирует параметр `PictureSourceType` (пользователь выбирает его в диалоговом окне)
+*   Игнорирует `PictureSourceType` параметр (пользователь выбирает его в диалоговом окне)
 
-*   Игнорирует параметр `encodingType`
+*   Игнорирует`encodingType`
 
-*   Игнорирует `targetWidth` и `targetHeight`
+*   Игнорирует `targetWidth` и`targetHeight`
 
-*   `Camera.MediaType` не поддерживается.
+*   `Camera.MediaType`не поддерживается.
 
-*   Игнорирует параметр `correctOrientation`.
+*   Игнорирует `correctOrientation` параметр.
 
-*   Игнорирует параметр `cameraDirection`.
+*   Игнорирует `cameraDirection` параметр.
 
-### Особенности iOS
+### iOS причуды
 
-*   Установите `quality` ниже 50, для того чтобы избежать ошибок памяти на некоторых устройствах.
+*   Задать `quality` ниже 50, чтобы избежать ошибок памяти на некоторых устройствах.
 
 *   При использовании `destinationType.FILE_URI` , фотографии сохраняются во временном каталоге приложения. Содержимое приложения временного каталога удаляется при завершении приложения.
 
-### Особенности Tizen
+### Причуды Tizen
 
-*   options, не поддерживается
+*   параметры, не поддерживаемые
 
 *   всегда возвращает URI файла
 
 ### Windows Phone 7 и 8 причуды
 
-*   Игнорирует параметр `allowEdit`.
+*   Игнорирует `allowEdit` параметр.
 
-*   Игнорирует параметр `correctOrientation`.
+*   Игнорирует `correctOrientation` параметр.
 
-*   Игнорирует параметр `cameraDirection`.
+*   Игнорирует `cameraDirection` параметр.
 
 *   Игнорирует `saveToPhotoAlbum` параметр. Важно: Все изображения, снятые камерой wp7/8 cordova API всегда копируются в рулон камеры телефона. В зависимости от параметров пользователя это также может означать, что изображение автоматически загружены на их OneDrive. Потенциально это может означать, что этот образ доступен для более широкой аудитории, чем ваше приложение предназначено. Если этот блокатор для вашего приложения, вам нужно будет осуществить CameraCaptureTask, как описано на сайте msdn: <http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh394006.aspx> вы можете также комментарий и�
 �и вверх голосование связанный с этим вопрос [отслеживания][3]
 
@@ -284,7 +294,7 @@ Tizen поддерживает только `destinationType` из `Camera.Desti
 
 ### Параметры
 
-*   **message**: сообщение об ошибке предоставляемое платформой устройства. *(Строка)*
+*   **сообщение**: сообщение обеспечивается устройства машинного кода. *(Строка)*
 
 ## cameraSuccess
 
@@ -297,7 +307,7 @@ onSuccess обратного вызова функция, которая пре
 
 ### Параметры
 
-*   **imageData**: Данные изображения в Base64 кодировке, *или* URI, в зависимости от применяемых параметров `cameraOptions`. *(Строка)*
+*   **imageData**: Base64 кодирование изображения данных, *или* файла изображения URI, в зависимости от `cameraOptions` в силу. *(Строка)*
 
 ### Пример
 
@@ -315,7 +325,7 @@ onSuccess обратного вызова функция, которая пре
 
 ### Методы
 
-*   **setPosition**: Задайте положение инструмента выбора изображения.
+*   **setPosition**: установить положение инструмента.
 
 ### Поддерживаемые платформы
 
@@ -327,7 +337,7 @@ onSuccess обратного вызова функция, которая пре
 
 **Параметры**:
 
-*   `cameraPopoverOptions`: Объект `CameraPopoverOptions`, определяющий новое положение
+*   `cameraPopoverOptions`: `CameraPopoverOptions` , укажите новое положение
 
 ### Пример
 
@@ -353,17 +363,23 @@ onSuccess обратного вызова функция, которая пре
 
 ### CameraPopoverOptions
 
-*   **x**: x координата в пикселях элемента экрана, на котором закрепить инструмента. *(Число)*
+*   **x**: x координата пикселя элемента экрана, на который для закрепления инструмента. *(Число)*
 
-*   **x**: y координата в пикселях элемента экрана, на котором закрепить инструмента. *(Число)*
+*   **y**: y координата пикселя элемента экрана, на который для закрепления инструмента. *(Число)*
 
-*   **width**: ширина в пикселях элемента экрана, на котором закрепить инструмент выбора изображения. *(Число)*
+*   **Ширина**: ширина в пикселях экрана элемента, на который для закрепления инструмента. *(Число)*
 
-*   **height**: высота в пикселях элемента экрана, на котором закрепить инструмент выбора изображения. *(Число)*
+*   **рост**: высота в пикселях экрана элемента, на который для закрепления инструмента. *(Число)*
 
-*   **arrowDir**: Направление, куда должна указывать стрелка на инструменте. Определено в `Camera.PopoverArrowDirection` *(число)*
+*   **arrowDir**: стрелка на пирог следует указывать направление. Определяется в `Camera.PopoverArrowDirection` *(число)*
     
-            Camera.PopoverArrowDirection = {ARROW_UP: 1, / / матчи iOS UIPopoverArrowDirection константы ARROW_DOWN: 2, ARROW_LEFT: 4, ARROW_RIGHT: 8, ARROW_ANY: 15};
+            Camera.PopoverArrowDirection = {
+                ARROW_UP : 1,        // matches iOS UIPopoverArrowDirection constants
+                ARROW_DOWN : 2,
+                ARROW_LEFT : 4,
+                ARROW_RIGHT : 8,
+                ARROW_ANY : 15
+            };
         
 
 Обратите внимание, что размер инструмента может измениться для регулировки в направлении стрелки и ориентации экрана. Убедитесь в том, что для учета изменения ориентации при указании расположения элемента привязки.

http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/e8519609/doc/zh/index.md
----------------------------------------------------------------------
diff --git a/doc/zh/index.md b/doc/zh/index.md
index 0565ab9..de5be22 100644
--- a/doc/zh/index.md
+++ b/doc/zh/index.md
@@ -66,6 +66,13 @@
 *   Windows Phone 7 和 8
 *   Windows 8
 
+### 首選項 (iOS)
+
+*   **CameraUsesGeolocation**(布林值,預設值為 false)。 用於捕獲 jpeg 檔,設置為 true,以在 EXIF 頭資訊中獲取地理定位資料。 這將觸發請求的地理位置的許可權,如果設置為 true。
+    
+        <preference name="CameraUsesGeolocation" value="false" />
+        
+
 ### 亞馬遜火 OS 怪癖
 
 亞馬遜火 OS 使用意向啟動捕獲圖像,在設備上的相機活動和與低記憶體手機,科爾多瓦活動可能被殺。 在此方案中,可能不會顯示圖像還原科爾多瓦活動時。
@@ -137,49 +144,64 @@ Tizen 僅支援 `destinationType` 的 `Camera.DestinationType.FILE_URI` 和 `sou
 
 ### 選項
 
-*   **品質**: 保存的圖像,表示為一系列的 0-100,在 100 哪裡通常全解析度而不會丟失檔的壓縮品質。 預設值為 50。 *(人數)*(請注意相機的解析度有關的資訊是不可用)。
+*   **品質**: 保存的圖像,表示為範圍 0-100,100,是通常全解析度,無損失從檔案壓縮的品質。 預設值為 50。 *(人數)*(請注意相機的解析度有關的資訊是不可用)。
 
 *   **可**: 選擇傳回值的格式。預設值是 FILE_URI。定義在 `navigator.camera.DestinationType` *(人數)*
     
-        Camera.DestinationType = {DATA_URL: 0,/ / 返回圖像作為 base64 編碼字串 FILE_URI: 1,/ / 返回影像檔的 URI NATIVE_URI: 2 / / 返回圖像本機 URI (例如,資產庫: / / 在 iOS 或內容上: / / 在 Android 上)} ;
+        Camera.DestinationType = {
+            DATA_URL : 0,      // Return image as base64-encoded string
+            FILE_URI : 1,      // Return image file URI
+            NATIVE_URI : 2     // Return image native URI (e.g., assets-library:// on iOS or content:// on Android)
+        };
         
 
 *   **時**: 設置圖片的來源。預設值是觀景窗。定義在 `navigator.camera.PictureSourceType` *(人數)*
     
-        Camera.PictureSourceType = {PHOTOLIBRARY: 0,相機: 1,SAVEDPHOTOALBUM: 2} ;
+        Camera.PictureSourceType = {
+            PHOTOLIBRARY : 0,
+            CAMERA : 1,
+            SAVEDPHOTOALBUM : 2
+        };
         
 
-*   **allowEdit**: 允許簡單編輯的選擇面前的形象。*(布林)*
+*   **allowEdit**: 允許簡單編輯前選擇圖像。*(布林)*
 
 *   **encodingType**: 選擇返回的影像檔的編碼。預設值為 JPEG。定義在 `navigator.camera.EncodingType` *(人數)*
     
-        Camera.EncodingType = {JPEG: 0,/ / 返回 JPEG 編碼的 PNG 圖像: 1 / / 返回 PNG 編碼的圖像} ;
+        Camera.EncodingType = {
+            JPEG : 0,               // Return JPEG encoded image
+            PNG : 1                 // Return PNG encoded image
+        };
         
 
-*   **targetWidth**: 以圖元為單位的尺度圖像的寬度。必須與**targetHeight**一起使用。縱橫比保持不變。*(人數)*
+*   **targetWidth**: 向尺度圖像的圖元寬度。必須用**targetHeight**。縱橫比保持不變。*(人數)*
 
-*   **targetHeight**: 以圖元為單位的尺度圖像的高度。必須與**targetWidth**一起使用。縱橫比保持不變。*(人數)*
+*   **targetHeight**: 以圖元為單位向尺度圖像的高度。必須用**targetWidth**。縱橫比保持不變。*(人數)*
 
-*   **媒體類型**: 設置要從選擇媒體的類型。 時才起作用 `PictureSourceType` 是 `PHOTOLIBRARY` 或 `SAVEDPHOTOALBUM` 。 定義在 `nagivator.camera.MediaType` *(人數)* 
+*   **媒體類型**: 設置的媒體,從選擇類型。 時才起作用 `PictureSourceType` 是 `PHOTOLIBRARY` 或 `SAVEDPHOTOALBUM` 。 定義在 `nagivator.camera.MediaType` *(人數)*
     
-        Camera.MediaType = {圖片: 0,/ / 允許只仍然圖片的選擇。 預設情況。 Will return format specified via DestinationType
+        Camera.MediaType = {
+            PICTURE: 0,    // allow selection of still pictures only. 預設情況。 Will return format specified via DestinationType
             VIDEO: 1,      // allow selection of video only, WILL ALWAYS RETURN FILE_URI
             ALLMEDIA : 2   // allow selection from all media types
         };
         
 
-*   **correctOrientation**: 旋轉圖像,期間擷取裝置的方向的正確。*(布林)*
+*   **correctOrientation**: 旋轉圖像,該設備時捕獲的定向的正確。*(布林)*
 
 *   **saveToPhotoAlbum**: 將圖像保存到相冊在設備上捕獲後。*(布林)*
 
-*   **popoverOptions**: 僅限 iOS 在 iPad 中指定彈出位置的選項。在中定義`CameraPopoverOptions`.
+*   **popoverOptions**: 只有 iOS 在 iPad 中指定氣泡框位置的選項。在中定義`CameraPopoverOptions`.
 
 *   **cameraDirection**: 選擇相機以使用 (前面或後面-面向)。預設值是背。定義在 `navigator.camera.Direction` *(人數)*
     
-        Camera.Direction = {回: 0,/ / 使用前面後面攝像頭: 1 / / 使用前置攝像頭} ;
+        Camera.Direction = {
+            BACK : 0,      // Use the back-facing camera
+            FRONT : 1      // Use the front-facing camera
+        };
         
 
-### 亞馬遜火 OSQuirks
+### 亞馬遜火 OS 怪癖
 
 *   任何 `cameraDirection` 值回朝的照片中的結果。
 
@@ -189,13 +211,13 @@ Tizen 僅支援 `destinationType` 的 `Camera.DestinationType.FILE_URI` 和 `sou
 
 ### Android 的怪癖
 
-*   任何 `cameraDirection` 值回朝的照片中的結果。
+*   任何 `cameraDirection` 值結果在背面的照片。
 
 *   忽略 `allowEdit` 參數。
 
-*   `Camera.PictureSourceType.PHOTOLIBRARY`和 `Camera.PictureSourceType.SAVEDPHOTOALBUM` 都顯示相同的相冊。
+*   `Camera.PictureSourceType.PHOTOLIBRARY`和 `Camera.PictureSourceType.SAVEDPHOTOALBUM` 都顯示相同的寫真集。
 
-### 黑莓 10 怪癖
+### 黑莓 10 的怪癖
 
 *   忽略 `quality` 參數。
 
@@ -219,7 +241,7 @@ Tizen 僅支援 `destinationType` 的 `Camera.DestinationType.FILE_URI` 和 `sou
 
 *   忽略`encodingType`
 
-*   忽略 `targetWidth` 和`targetHeight`
+*   忽略了 `targetWidth` 和`targetHeight`
 
 *   `Camera.MediaType`不受支援。
 
@@ -237,9 +259,9 @@ Tizen 僅支援 `destinationType` 的 `Camera.DestinationType.FILE_URI` 和 `sou
 
 *   不支援的選項
 
-*   始終返回一個檔的 URI
+*   總是返回一個檔的 URI
 
-### Windows Phone 7 和 8 怪癖
+### Windows Phone 7 和 8 的怪癖
 
 *   忽略 `allowEdit` 參數。
 
@@ -278,7 +300,7 @@ onSuccess 提供的圖像資料的回呼函數。
 
 ### 參數
 
-*   **把圖像資料**: Base64 編碼的圖像資料,*或*影像檔的 URI,取決於 `cameraOptions` 生效。*(字串)*
+*   **圖像資料**: Base64 編碼進行編碼的圖像資料,*或*影像檔的 URI,取決於 `cameraOptions` 效果。*(字串)*
 
 ### 示例
 
@@ -296,7 +318,7 @@ onSuccess 提供的圖像資料的回呼函數。
 
 ### 方法
 
-*   **setPosition**: 設置彈出的位置。
+*   **setPosition**: 設置氣泡框的位置。
 
 ### 支援的平臺
 
@@ -334,17 +356,23 @@ iOS 僅指定彈出的錨元素的位置和箭頭方向,從 iPad 的庫或專
 
 ### CameraPopoverOptions
 
-*   **x**: 圖元的 x 座標上的錨定彈出螢幕元素。*(人數)*
+*   **x**: x 螢幕元素到其錨定氣泡框上的圖元座標。*(人數)*
 
-*   **y**: 到其錨定彈出螢幕元素的 y 圖元座標。*(人數)*
+*   **y**: 螢幕元素到其錨定氣泡框上的 y 圖元座標。*(人數)*
 
-*   **寬度**: 寬度以圖元為單位),到其錨定彈出螢幕元素。*(人數)*
+*   **寬度**: 寬度以圖元為單位),到其錨定氣泡框上的螢幕元素。*(人數)*
 
-*   **高度**: 高度以圖元為單位),到其錨定彈出螢幕元素。*(人數)*
+*   **高度**: 高度以圖元為單位),到其錨定氣泡框上的螢幕元素。*(人數)*
 
-*   **arrowDir**: 上彈出的箭頭應指向的方向。定義在 `Camera.PopoverArrowDirection` *(人數)* 
+*   **arrowDir**: 氣泡框上的箭頭應指向的方向。定義在 `Camera.PopoverArrowDirection` *(人數)*
     
-            Camera.PopoverArrowDirection = {ARROW_UP: 1,/ / 匹配 iOS UIPopoverArrowDirection 常量 ARROW_DOWN: 2,ARROW_LEFT: 4,ARROW_RIGHT: 8,ARROW_ANY: 15} ;
+            Camera.PopoverArrowDirection = {
+                ARROW_UP : 1,        // matches iOS UIPopoverArrowDirection constants
+                ARROW_DOWN : 2,
+                ARROW_LEFT : 4,
+                ARROW_RIGHT : 8,
+                ARROW_ANY : 15
+            };
         
 
 請注意彈出的大小可能會更改箭頭的方向和螢幕的方向調整。 請確保帳戶方向更改時指定的錨點的元素位置。
@@ -356,7 +384,7 @@ iOS 僅指定彈出的錨元素的位置和箭頭方向,從 iPad 的庫或專
     navigator.camera.cleanup( cameraSuccess, cameraError );
     
 
-### 說明
+### 描述
 
 刪除中間打完電話後保留在臨時存儲的影像檔 `camera.getPicture` 。 適用時,才的價值 `Camera.sourceType` 等於 `Camera.PictureSourceType.CAMERA` 和 `Camera.destinationType` 等於`Camera.DestinationType.FILE_URI`.
 


[03/11] git commit: CB-7378 Adds support for windows platform

Posted by an...@apache.org.
CB-7378 Adds support for windows platform


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/commit/f3cfadb1
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/tree/f3cfadb1
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/diff/f3cfadb1

Branch: refs/heads/master
Commit: f3cfadb19e7312c85934d9d241e0ed4cc0c3b13c
Parents: e9a8349
Author: Vladimir Kotikov <v-...@microsoft.com>
Authored: Wed Aug 27 17:15:47 2014 +0400
Committer: Anis Kadri <an...@apache.org>
Committed: Fri Sep 5 11:07:49 2014 -0700

----------------------------------------------------------------------
 src/windows8/CameraProxy.js | 341 ++++++++++++++++++++++++++++-----------
 1 file changed, 245 insertions(+), 96 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/f3cfadb1/src/windows8/CameraProxy.js
----------------------------------------------------------------------
diff --git a/src/windows8/CameraProxy.js b/src/windows8/CameraProxy.js
index 7e6c21e..0924e5c 100644
--- a/src/windows8/CameraProxy.js
+++ b/src/windows8/CameraProxy.js
@@ -40,6 +40,7 @@ module.exports = {
     // 8 correctOrientation:false,
     // 9 saveToPhotoAlbum:false,
     // 10 popoverOptions:null
+    // 11 cameraDirection:0
 
     takePicture: function (successCallback, errorCallback, args) {
         var encodingType = args[5];
@@ -48,7 +49,9 @@ module.exports = {
         var sourceType = args[2];
         var destinationType = args[1];
         var mediaType = args[6];
+        var allowCrop = !!args[7];
         var saveToPhotoAlbum = args[9];
+        var cameraDirection = args[11];
 
         // resize method :)
         var resizeImage = function (file) {
@@ -129,6 +132,17 @@ module.exports = {
         };
 
         if (sourceType != Camera.PictureSourceType.CAMERA) {
+
+            // TODO: Add WP8.1 support
+            // WP8.1 doesn't allow to use of pickSingleFileAsync method
+            // see http://msdn.microsoft.com/en-us/library/windows/apps/br207852.aspx for details
+            // replacement of pickSingleFileAsync - pickSingleFileAndContinue method
+            // will take application to suspended state and this require additional logic to wake application up
+            if (navigator.appVersion.indexOf('Windows Phone 8.1') >= 0 ) {
+                errorCallback('Not supported');
+                return;
+            }
+
             var fileOpenPicker = new Windows.Storage.Pickers.FileOpenPicker();
             fileOpenPicker.suggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.picturesLibrary;
             if (mediaType == Camera.MediaType.PICTURE) {
@@ -141,9 +155,9 @@ module.exports = {
                 fileOpenPicker.fileTypeFilter.replaceAll(["*"]);
             }
 
-            fileOpenPicker.pickSingleFileAsync().then(function (file) {
+            fileOpenPicker.pickSingleFileAsync().done(function (file) {
                 if (file) {
-                    if (destinationType == Camera.DestinationType.FILE_URI) {
+                    if (destinationType == Camera.DestinationType.FILE_URI || destinationType == Camera.DestinationType.NATIVE_URI) {
                         if (targetHeight > 0 && targetWidth > 0) {
                             resizeImage(file);
                         }
@@ -176,115 +190,250 @@ module.exports = {
             }, function () {
                 errorCallback("User didn't choose a file.");
             });
-        }
-        else {
 
-            var cameraCaptureUI = new Windows.Media.Capture.CameraCaptureUI();
-            cameraCaptureUI.photoSettings.allowCropping = true;
-            var allowCrop = !!args[7];
-            if (!allowCrop) {
-                cameraCaptureUI.photoSettings.allowCropping = false;
-            }
+        } else {
 
-            if (encodingType == Camera.EncodingType.PNG) {
-                cameraCaptureUI.photoSettings.format = Windows.Media.Capture.CameraCaptureUIPhotoFormat.png;
-            } else {
-                cameraCaptureUI.photoSettings.format = Windows.Media.Capture.CameraCaptureUIPhotoFormat.jpeg;
-            }
+            var CaptureNS = Windows.Media.Capture;
 
-            // decide which max pixels should be supported by targetWidth or targetHeight.
-            if (targetWidth >= 1280 || targetHeight >= 960) {
-                cameraCaptureUI.photoSettings.maxResolution = Windows.Media.Capture.CameraCaptureUIMaxPhotoResolution.large3M;
-            }
-            else if (targetWidth >= 1024 || targetHeight >= 768) {
-                cameraCaptureUI.photoSettings.maxResolution = Windows.Media.Capture.CameraCaptureUIMaxPhotoResolution.mediumXga;
-            }
-            else if (targetWidth >= 800 || targetHeight >= 600) {
-                cameraCaptureUI.photoSettings.maxResolution = Windows.Media.Capture.CameraCaptureUIMaxPhotoResolution.mediumXga;
-            }
-            else if (targetWidth >= 640 || targetHeight >= 480) {
-                cameraCaptureUI.photoSettings.maxResolution = Windows.Media.Capture.CameraCaptureUIMaxPhotoResolution.smallVga;
-            }
-            else if (targetWidth >= 320 || targetHeight >= 240) {
-                cameraCaptureUI.photoSettings.maxResolution = Windows.Media.Capture.CameraCaptureUIMaxPhotoResolution.verySmallQvga;
-            }
-            else {
-                cameraCaptureUI.photoSettings.maxResolution = Windows.Media.Capture.CameraCaptureUIMaxPhotoResolution.highestAvailable;
-            }
+            // Check if necessary API available
+            if (!CaptureNS.CameraCaptureUI) {
+                // We are running on WP8.1 which lacks CameraCaptureUI class
+                // so we need to use MediaCapture class instead and implement custom UI for camera
 
-            cameraCaptureUI.captureFileAsync(Windows.Media.Capture.CameraCaptureUIMode.photo).then(function (picture) {
-                if (picture) {
-                    // save to photo album successCallback
-                    var success = function () {
-                        if (destinationType == Camera.DestinationType.FILE_URI) {
-                            if (targetHeight > 0 && targetWidth > 0) {
-                                resizeImage(picture);
-                            } else {
+                var capturePreview = null,
+                    captureCancelButton = null,
+                    capture = null,
+                    captureSettings = null;
 
-                                var storageFolder = Windows.Storage.ApplicationData.current.localFolder;
-                                picture.copyAsync(storageFolder, picture.name, Windows.Storage.NameCollisionOption.replaceExisting).then(function (storageFile) {
-                                    successCallback("ms-appdata:///local/" + storageFile.name);
-                                }, function () {
-                                    errorCallback("Can't access localStorage folder.");
-                                });
-                            }
+                var createCameraUI = function () {
+
+                    // Create fullscreen preview
+                    capturePreview = document.createElement("video");
+
+                    // z-order style element for capturePreview and captureCancelButton elts
+                    // is necessary to avoid overriding by another page elements, -1 sometimes is not enough
+                    capturePreview.style.cssText = "position: fixed; left: 0; top: 0; width: 100%; height: 100%; z-order: 999";
+
+                    // Create cancel button
+                    captureCancelButton = document.createElement("button");
+                    captureCancelButton.innerText = "Cancel";
+                    captureCancelButton.style.cssText = "position: fixed; right: 0; bottom: 0; display: block; margin: 20px; z-order: 1000";
+
+                    capture = new CaptureNS.MediaCapture();
+
+                    captureSettings = new CaptureNS.MediaCaptureInitializationSettings();
+                    captureSettings.streamingCaptureMode = CaptureNS.StreamingCaptureMode.video;
+                };
+
+                var startCameraPreview = function () {
+
+                    // Search for available camera devices
+                    // This is necessary to detect which camera (front or back) we should use
+                    var expectedPanel = cameraDirection === 1 ? Windows.Devices.Enumeration.Panel.front : Windows.Devices.Enumeration.Panel.back;
+                    Windows.Devices.Enumeration.DeviceInformation.findAllAsync(Windows.Devices.Enumeration.DeviceClass.videoCapture)
+                    .done(function (devices) {
+                        if (devices.length > 0) {
+                            devices.forEach(function(currDev) {
+                                if (currDev.enclosureLocation.panel && currDev.enclosureLocation.panel == expectedPanel) {
+                                    captureSettings.videoDeviceId = currDev.id;
+                                }
+                            });
+
+                            capture.initializeAsync(captureSettings).done(function () {
+                                // This is necessary since WP8.1 MediaCapture outputs video stream rotated 90 degrees CCW
+                                // TODO: This can be not consistent across devices, need additional testing on various devices
+                                capture.setPreviewRotation(Windows.Media.Capture.VideoRotation.clockwise90Degrees);
+                                // msdn.microsoft.com/en-us/library/windows/apps/hh452807.aspx
+                                capturePreview.msZoom = true;
+                                capturePreview.src = URL.createObjectURL(capture);
+                                capturePreview.play();
+
+                                // Insert preview frame and controls into page
+                                document.body.appendChild(capturePreview);
+                                document.body.appendChild(captureCancelButton);
+
+                                // Bind events to controls
+                                capturePreview.addEventListener('click', captureAction);
+                                captureCancelButton.addEventListener('click', function () {
+                                    destroyCameraPreview();
+                                    errorCallback('Cancelled');
+                                }, false);
+                            }, function (err) {
+                                destroyCameraPreview();
+                                errorCallback('Camera intitialization error ' + err);
+                            });
                         } else {
-                            if (targetHeight > 0 && targetWidth > 0) {
-                                resizeImageBase64(picture);
-                            } else {
-                                Windows.Storage.FileIO.readBufferAsync(picture).done(function (buffer) {
-                                    var strBase64 = Windows.Security.Cryptography.CryptographicBuffer.encodeToBase64String(buffer);
-                                    successCallback(strBase64);
-                                });
-                            }
+                            destroyCameraPreview();
+                            errorCallback('Camera not found');
                         }
-                    };
-                    // save to photo album errorCallback
-                    var fail = function () {
-                        //errorCallback("FileError, code:" + fileError.code);
-                        errorCallback("Save fail.");
-                    };
+                    });
+                };
 
-                    if (saveToPhotoAlbum) {
-                        Windows.Storage.StorageFile.getFileFromPathAsync(picture.path).then(function (storageFile) {
-                            storageFile.copyAsync(Windows.Storage.KnownFolders.picturesLibrary, picture.name, Windows.Storage.NameCollisionOption.generateUniqueName).then(function (storageFile) {
-                                success();
-                            }, function () {
-                                fail();
-                            });
-                        });
-                        //var directory = new DirectoryEntry("Pictures", parentPath);
-                        //new FileEntry(picture.name, picture.path).copyTo(directory, null, success, fail);
+                var destroyCameraPreview = function () {
+                    capturePreview.pause();
+                    capturePreview.src = null;
+                    [capturePreview, captureCancelButton].forEach(function(elem) {
+                        if (elem /* && elem in document.body.childNodes */) {
+                            document.body.removeChild(elem);
+                        }
+                    });
+                    if (capture) {
+                        capture.stopRecordAsync();
+                        capture = null;
+                    }
+                };
+
+                var captureAction = function () {
+
+                    var encodingProperties,
+                        fileName,
+                        generateUniqueCollisionOption = Windows.Storage.CreationCollisionOption.generateUniqueName,
+                        tempFolder = Windows.Storage.ApplicationData.current.temporaryFolder;
+
+                    if (encodingType == Camera.EncodingType.PNG) {
+                        fileName = 'photo.png';
+                        encodingProperties = Windows.Media.MediaProperties.ImageEncodingProperties.createPng();
                     } else {
-                        if (destinationType == Camera.DestinationType.FILE_URI) {
-                            if (targetHeight > 0 && targetWidth > 0) {
-                                resizeImage(picture);
-                            } else {
+                        fileName = 'photo.jpg';
+                        encodingProperties = Windows.Media.MediaProperties.ImageEncodingProperties.createJpeg();
+                    }
 
-                                var storageFolder = Windows.Storage.ApplicationData.current.localFolder;
-                                picture.copyAsync(storageFolder, picture.name, Windows.Storage.NameCollisionOption.replaceExisting).then(function (storageFile) {
-                                    successCallback("ms-appdata:///local/" + storageFile.name);
-                                }, function () {
-                                    errorCallback("Can't access localStorage folder.");
-                                });
+                    tempFolder.createFileAsync(fileName, generateUniqueCollisionOption).done(function(capturedFile) {
+                        capture.capturePhotoToStorageFileAsync(encodingProperties, capturedFile).done(function() {
+
+                            destroyCameraPreview();
+
+                            // success callback for capture operation
+                            var success = function(capturedfile) {
+                                if (destinationType == Camera.DestinationType.FILE_URI || destinationType == Camera.DestinationType.NATIVE_URI) {
+                                    if (targetHeight > 0 && targetWidth > 0) {
+                                        resizeImage(capturedfile);
+                                    } else {
+                                        capturedfile.copyAsync(Windows.Storage.ApplicationData.current.localFolder, capturedfile.name, generateUniqueCollisionOption).done(function(copiedfile) {
+                                            successCallback("ms-appdata:///local/" + copiedfile.name);
+                                        }, errorCallback);
+                                    }
+                                } else {
+                                    if (targetHeight > 0 && targetWidth > 0) {
+                                        resizeImageBase64(capturedfile);
+                                    } else {
+                                        Windows.Storage.FileIO.readBufferAsync(capturedfile).done(function(buffer) {
+                                            var strBase64 = Windows.Security.Cryptography.CryptographicBuffer.encodeToBase64String(buffer);
+                                            capturedfile.deleteAsync().done(function() {
+                                                successCallback(strBase64);
+                                            }, function(err) {
+                                                console.error(err);
+                                                successCallback(strBase64);
+                                            });
+                                        }, errorCallback);
+                                    }
+                                }
+                            };
+
+                            if (saveToPhotoAlbum) {
+                                capturedFile.copyAsync(Windows.Storage.KnownFolders.picturesLibrary, capturedFile.name, generateUniqueCollisionOption)
+                                .done(function() {
+                                    success(capturedFile);
+                                }, errorCallback);
+                            } else {
+                                success(capturedFile);
                             }
-                        } else {
-                            if (targetHeight > 0 && targetWidth > 0) {
-                                resizeImageBase64(picture);
+
+
+                        }, function(err) {
+                            destroyCameraPreview();
+                            errorCallback(err);
+                        });
+                    }, function(err) {
+                        destroyCameraPreview();
+                        errorCallback(err);
+                    });
+                };
+
+                try {
+                    createCameraUI();
+                    startCameraPreview();
+                } catch (ex) {
+                    errorCallback(ex);
+                }
+
+            } else {
+
+                var cameraCaptureUI = new Windows.Media.Capture.CameraCaptureUI();
+                cameraCaptureUI.photoSettings.allowCropping = allowCrop;
+
+                if (encodingType == Camera.EncodingType.PNG) {
+                    cameraCaptureUI.photoSettings.format = Windows.Media.Capture.CameraCaptureUIPhotoFormat.png;
+                } else {
+                    cameraCaptureUI.photoSettings.format = Windows.Media.Capture.CameraCaptureUIPhotoFormat.jpeg;
+                }
+
+                // decide which max pixels should be supported by targetWidth or targetHeight.
+                if (targetWidth >= 1280 || targetHeight >= 960) {
+                    cameraCaptureUI.photoSettings.maxResolution = Windows.Media.Capture.CameraCaptureUIMaxPhotoResolution.large3M;
+                } else if (targetWidth >= 1024 || targetHeight >= 768) {
+                    cameraCaptureUI.photoSettings.maxResolution = Windows.Media.Capture.CameraCaptureUIMaxPhotoResolution.mediumXga;
+                } else if (targetWidth >= 800 || targetHeight >= 600) {
+                    cameraCaptureUI.photoSettings.maxResolution = Windows.Media.Capture.CameraCaptureUIMaxPhotoResolution.mediumXga;
+                } else if (targetWidth >= 640 || targetHeight >= 480) {
+                    cameraCaptureUI.photoSettings.maxResolution = Windows.Media.Capture.CameraCaptureUIMaxPhotoResolution.smallVga;
+                } else if (targetWidth >= 320 || targetHeight >= 240) {
+                    cameraCaptureUI.photoSettings.maxResolution = Windows.Media.Capture.CameraCaptureUIMaxPhotoResolution.verySmallQvga;
+                } else {
+                    cameraCaptureUI.photoSettings.maxResolution = Windows.Media.Capture.CameraCaptureUIMaxPhotoResolution.highestAvailable;
+                }
+
+                cameraCaptureUI.captureFileAsync(Windows.Media.Capture.CameraCaptureUIMode.photo).then(function(picture) {
+                    if (picture) {
+                        // save to photo album successCallback
+                        var success = function() {
+                            if (destinationType == Camera.DestinationType.FILE_URI) {
+                                if (targetHeight > 0 && targetWidth > 0) {
+                                    resizeImage(picture);
+                                } else {
+
+                                    var storageFolder = Windows.Storage.ApplicationData.current.localFolder;
+                                    picture.copyAsync(storageFolder, picture.name, Windows.Storage.NameCollisionOption.replaceExisting).then(function(storageFile) {
+                                        successCallback("ms-appdata:///local/" + storageFile.name);
+                                    }, function() {
+                                        errorCallback("Can't access localStorage folder.");
+                                    });
+                                }
                             } else {
-                                Windows.Storage.FileIO.readBufferAsync(picture).done(function (buffer) {
-                                    var strBase64 = Windows.Security.Cryptography.CryptographicBuffer.encodeToBase64String(buffer);
-                                    successCallback(strBase64);
-                                });
+                                if (targetHeight > 0 && targetWidth > 0) {
+                                    resizeImageBase64(picture);
+                                } else {
+                                    Windows.Storage.FileIO.readBufferAsync(picture).done(function(buffer) {
+                                        var strBase64 = Windows.Security.Cryptography.CryptographicBuffer.encodeToBase64String(buffer);
+                                        successCallback(strBase64);
+                                    });
+                                }
                             }
+                        };
+                        // save to photo album errorCallback
+                        var fail = function() {
+                            //errorCallback("FileError, code:" + fileError.code);
+                            errorCallback("Save fail.");
+                        };
+
+                        if (saveToPhotoAlbum) {
+                            Windows.Storage.StorageFile.getFileFromPathAsync(picture.path).then(function(storageFile) {
+                                storageFile.copyAsync(Windows.Storage.KnownFolders.picturesLibrary, picture.name, Windows.Storage.NameCollisionOption.generateUniqueName).then(function(storageFile) {
+                                    success();
+                                }, function() {
+                                    fail();
+                                });
+                            });
+                        } else {
+                            success();
                         }
+                    } else {
+                        errorCallback("User didn't capture a photo.");
                     }
-                } else {
-                    errorCallback("User didn't capture a photo.");
-                }
-            }, function () {
-                errorCallback("Fail to capture a photo.");
-            });
+                }, function() {
+                    errorCallback("Fail to capture a photo.");
+                });
+            }
         }
     }
 };


[07/11] git commit: CB-7378 Use single Proxy for both windows8 and windows.

Posted by an...@apache.org.
CB-7378 Use single Proxy for both windows8 and windows.


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/commit/6dcfa9cf
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/tree/6dcfa9cf
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/diff/6dcfa9cf

Branch: refs/heads/master
Commit: 6dcfa9cf9bc4ce3646e1fc117874e3d243d94069
Parents: f3cfadb
Author: Vladimir Kotikov <v-...@microsoft.com>
Authored: Wed Aug 27 17:18:22 2014 +0400
Committer: Anis Kadri <an...@apache.org>
Committed: Fri Sep 5 11:08:15 2014 -0700

----------------------------------------------------------------------
 plugin.xml                  |  26 ++-
 src/windows/CameraProxy.js  | 441 +++++++++++++++++++++++++++++++++++++++
 src/windows8/CameraProxy.js | 441 ---------------------------------------
 3 files changed, 466 insertions(+), 442 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/6dcfa9cf/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index 9f3bfad..c660813 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -212,7 +212,7 @@
         <js-module src="www/CameraPopoverHandle.js" name="CameraPopoverHandle">
             <clobbers target="CameraPopoverHandle" />
         </js-module>
-        <js-module src="src/windows8/CameraProxy.js" name="CameraProxy">
+        <js-module src="src/windows/CameraProxy.js" name="CameraProxy">
             <merges target="" />
         </js-module>
 
@@ -231,4 +231,28 @@
         </js-module>
     </platform>
 
+    <!-- windows -->
+    <platform name="windows">
+        <config-file target="package.windows.appxmanifest" parent="/Package/Capabilities">
+            <Capability Name="picturesLibrary" />
+            <DeviceCapability Name="webcam" />
+        </config-file>
+        <config-file target="package.windows80.appxmanifest" parent="/Package/Capabilities">
+            <Capability Name="picturesLibrary" />
+            <DeviceCapability Name="webcam" />
+        </config-file>
+        <config-file target="package.phone.appxmanifest" parent="/Package/Capabilities">
+            <Capability Name="picturesLibrary" />
+            <DeviceCapability Name="webcam" />
+        </config-file>
+        <js-module src="www/CameraPopoverHandle.js" name="CameraPopoverHandle">
+            <clobbers target="CameraPopoverHandle" />
+        </js-module>
+        <js-module src="src/windows/CameraProxy.js" name="CameraProxy">
+            <merges target="" />
+        </js-module>
+    </platform>
+
+
+
 </plugin>

http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/6dcfa9cf/src/windows/CameraProxy.js
----------------------------------------------------------------------
diff --git a/src/windows/CameraProxy.js b/src/windows/CameraProxy.js
new file mode 100644
index 0000000..0924e5c
--- /dev/null
+++ b/src/windows/CameraProxy.js
@@ -0,0 +1,441 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/*global Windows:true, URL:true */
+
+
+    var cordova = require('cordova'),
+        Camera = require('./Camera');
+
+module.exports = {
+
+    // args will contain :
+    //  ...  it is an array, so be careful
+    // 0 quality:50,
+    // 1 destinationType:Camera.DestinationType.FILE_URI,
+    // 2 sourceType:Camera.PictureSourceType.CAMERA,
+    // 3 targetWidth:-1,
+    // 4 targetHeight:-1,
+    // 5 encodingType:Camera.EncodingType.JPEG,
+    // 6 mediaType:Camera.MediaType.PICTURE,
+    // 7 allowEdit:false,
+    // 8 correctOrientation:false,
+    // 9 saveToPhotoAlbum:false,
+    // 10 popoverOptions:null
+    // 11 cameraDirection:0
+
+    takePicture: function (successCallback, errorCallback, args) {
+        var encodingType = args[5];
+        var targetWidth = args[3];
+        var targetHeight = args[4];
+        var sourceType = args[2];
+        var destinationType = args[1];
+        var mediaType = args[6];
+        var allowCrop = !!args[7];
+        var saveToPhotoAlbum = args[9];
+        var cameraDirection = args[11];
+
+        // resize method :)
+        var resizeImage = function (file) {
+            var tempPhotoFileName = "";
+            if (encodingType == Camera.EncodingType.PNG) {
+                tempPhotoFileName = "camera_cordova_temp_return.png";
+            } else {
+                tempPhotoFileName = "camera_cordova_temp_return.jpg";
+            }
+
+            var storageFolder = Windows.Storage.ApplicationData.current.localFolder;
+            file.copyAsync(storageFolder, file.name, Windows.Storage.NameCollisionOption.replaceExisting).then(function (storageFile) {
+                Windows.Storage.FileIO.readBufferAsync(storageFile).then(function(buffer) {
+                    var strBase64 = Windows.Security.Cryptography.CryptographicBuffer.encodeToBase64String(buffer);
+                    var imageData = "data:" + file.contentType + ";base64," + strBase64;
+                    var image = new Image();
+                    image.src = imageData;
+                    image.onload = function() {
+                        var imageWidth = targetWidth,
+                            imageHeight = targetHeight;
+                        var canvas = document.createElement('canvas');
+
+                        canvas.width = imageWidth;
+                        canvas.height = imageHeight;
+
+                        canvas.getContext("2d").drawImage(this, 0, 0, imageWidth, imageHeight);
+
+                        var fileContent = canvas.toDataURL(file.contentType).split(',')[1];
+
+                        var storageFolder = Windows.Storage.ApplicationData.current.localFolder;
+
+                        storageFolder.createFileAsync(tempPhotoFileName, Windows.Storage.CreationCollisionOption.generateUniqueName).done(function (storagefile) {
+                            var content = Windows.Security.Cryptography.CryptographicBuffer.decodeFromBase64String(fileContent);
+                            Windows.Storage.FileIO.writeBufferAsync(storagefile, content).then(function () {
+                                successCallback("ms-appdata:///local/" + storagefile.name);
+                            }, function () {
+                                errorCallback("Resize picture error.");
+                            });
+                        });
+                    };
+                });
+            }, function () {
+                errorCallback("Can't access localStorage folder");
+            });
+
+        };
+
+        // because of asynchronous method, so let the successCallback be called in it.
+        var resizeImageBase64 = function (file) {
+
+            Windows.Storage.FileIO.readBufferAsync(file).done( function(buffer) {
+                var strBase64 = Windows.Security.Cryptography.CryptographicBuffer.encodeToBase64String(buffer);
+                var imageData = "data:" + file.contentType + ";base64," + strBase64;
+
+                var image = new Image();
+                image.src = imageData;
+
+                image.onload = function() {
+                    var imageWidth = targetWidth,
+                        imageHeight = targetHeight;
+                    var canvas = document.createElement('canvas');
+
+                    canvas.width = imageWidth;
+                    canvas.height = imageHeight;
+
+                    var ctx = canvas.getContext("2d");
+                    ctx.drawImage(this, 0, 0, imageWidth, imageHeight);
+
+                    // The resized file ready for upload
+                    var finalFile = canvas.toDataURL(file.contentType);
+
+                    // Remove the prefix such as "data:" + contentType + ";base64," , in order to meet the Cordova API.
+                    var arr = finalFile.split(",");
+                    var newStr = finalFile.substr(arr[0].length + 1);
+                    successCallback(newStr);
+                };
+            });
+        };
+
+        if (sourceType != Camera.PictureSourceType.CAMERA) {
+
+            // TODO: Add WP8.1 support
+            // WP8.1 doesn't allow to use of pickSingleFileAsync method
+            // see http://msdn.microsoft.com/en-us/library/windows/apps/br207852.aspx for details
+            // replacement of pickSingleFileAsync - pickSingleFileAndContinue method
+            // will take application to suspended state and this require additional logic to wake application up
+            if (navigator.appVersion.indexOf('Windows Phone 8.1') >= 0 ) {
+                errorCallback('Not supported');
+                return;
+            }
+
+            var fileOpenPicker = new Windows.Storage.Pickers.FileOpenPicker();
+            fileOpenPicker.suggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.picturesLibrary;
+            if (mediaType == Camera.MediaType.PICTURE) {
+                fileOpenPicker.fileTypeFilter.replaceAll([".png", ".jpg", ".jpeg"]);
+            }
+            else if (mediaType == Camera.MediaType.VIDEO) {
+                fileOpenPicker.fileTypeFilter.replaceAll([".avi", ".flv", ".asx", ".asf", ".mov", ".mp4", ".mpg", ".rm", ".srt", ".swf", ".wmv", ".vob"]);
+            }
+            else {
+                fileOpenPicker.fileTypeFilter.replaceAll(["*"]);
+            }
+
+            fileOpenPicker.pickSingleFileAsync().done(function (file) {
+                if (file) {
+                    if (destinationType == Camera.DestinationType.FILE_URI || destinationType == Camera.DestinationType.NATIVE_URI) {
+                        if (targetHeight > 0 && targetWidth > 0) {
+                            resizeImage(file);
+                        }
+                        else {
+
+                            var storageFolder = Windows.Storage.ApplicationData.current.localFolder;
+                            file.copyAsync(storageFolder, file.name, Windows.Storage.NameCollisionOption.replaceExisting).then(function (storageFile) {
+                                successCallback(URL.createObjectURL(storageFile));
+                            }, function () {
+                                errorCallback("Can't access localStorage folder.");
+                            });
+
+                        }
+                    }
+                    else {
+                        if (targetHeight > 0 && targetWidth > 0) {
+                            resizeImageBase64(file);
+                        } else {
+                            Windows.Storage.FileIO.readBufferAsync(file).done(function (buffer) {
+                                var strBase64 = Windows.Security.Cryptography.CryptographicBuffer.encodeToBase64String(buffer);
+                                successCallback(strBase64);
+                            });
+                        }
+
+                    }
+
+                } else {
+                    errorCallback("User didn't choose a file.");
+                }
+            }, function () {
+                errorCallback("User didn't choose a file.");
+            });
+
+        } else {
+
+            var CaptureNS = Windows.Media.Capture;
+
+            // Check if necessary API available
+            if (!CaptureNS.CameraCaptureUI) {
+                // We are running on WP8.1 which lacks CameraCaptureUI class
+                // so we need to use MediaCapture class instead and implement custom UI for camera
+
+                var capturePreview = null,
+                    captureCancelButton = null,
+                    capture = null,
+                    captureSettings = null;
+
+                var createCameraUI = function () {
+
+                    // Create fullscreen preview
+                    capturePreview = document.createElement("video");
+
+                    // z-order style element for capturePreview and captureCancelButton elts
+                    // is necessary to avoid overriding by another page elements, -1 sometimes is not enough
+                    capturePreview.style.cssText = "position: fixed; left: 0; top: 0; width: 100%; height: 100%; z-order: 999";
+
+                    // Create cancel button
+                    captureCancelButton = document.createElement("button");
+                    captureCancelButton.innerText = "Cancel";
+                    captureCancelButton.style.cssText = "position: fixed; right: 0; bottom: 0; display: block; margin: 20px; z-order: 1000";
+
+                    capture = new CaptureNS.MediaCapture();
+
+                    captureSettings = new CaptureNS.MediaCaptureInitializationSettings();
+                    captureSettings.streamingCaptureMode = CaptureNS.StreamingCaptureMode.video;
+                };
+
+                var startCameraPreview = function () {
+
+                    // Search for available camera devices
+                    // This is necessary to detect which camera (front or back) we should use
+                    var expectedPanel = cameraDirection === 1 ? Windows.Devices.Enumeration.Panel.front : Windows.Devices.Enumeration.Panel.back;
+                    Windows.Devices.Enumeration.DeviceInformation.findAllAsync(Windows.Devices.Enumeration.DeviceClass.videoCapture)
+                    .done(function (devices) {
+                        if (devices.length > 0) {
+                            devices.forEach(function(currDev) {
+                                if (currDev.enclosureLocation.panel && currDev.enclosureLocation.panel == expectedPanel) {
+                                    captureSettings.videoDeviceId = currDev.id;
+                                }
+                            });
+
+                            capture.initializeAsync(captureSettings).done(function () {
+                                // This is necessary since WP8.1 MediaCapture outputs video stream rotated 90 degrees CCW
+                                // TODO: This can be not consistent across devices, need additional testing on various devices
+                                capture.setPreviewRotation(Windows.Media.Capture.VideoRotation.clockwise90Degrees);
+                                // msdn.microsoft.com/en-us/library/windows/apps/hh452807.aspx
+                                capturePreview.msZoom = true;
+                                capturePreview.src = URL.createObjectURL(capture);
+                                capturePreview.play();
+
+                                // Insert preview frame and controls into page
+                                document.body.appendChild(capturePreview);
+                                document.body.appendChild(captureCancelButton);
+
+                                // Bind events to controls
+                                capturePreview.addEventListener('click', captureAction);
+                                captureCancelButton.addEventListener('click', function () {
+                                    destroyCameraPreview();
+                                    errorCallback('Cancelled');
+                                }, false);
+                            }, function (err) {
+                                destroyCameraPreview();
+                                errorCallback('Camera intitialization error ' + err);
+                            });
+                        } else {
+                            destroyCameraPreview();
+                            errorCallback('Camera not found');
+                        }
+                    });
+                };
+
+                var destroyCameraPreview = function () {
+                    capturePreview.pause();
+                    capturePreview.src = null;
+                    [capturePreview, captureCancelButton].forEach(function(elem) {
+                        if (elem /* && elem in document.body.childNodes */) {
+                            document.body.removeChild(elem);
+                        }
+                    });
+                    if (capture) {
+                        capture.stopRecordAsync();
+                        capture = null;
+                    }
+                };
+
+                var captureAction = function () {
+
+                    var encodingProperties,
+                        fileName,
+                        generateUniqueCollisionOption = Windows.Storage.CreationCollisionOption.generateUniqueName,
+                        tempFolder = Windows.Storage.ApplicationData.current.temporaryFolder;
+
+                    if (encodingType == Camera.EncodingType.PNG) {
+                        fileName = 'photo.png';
+                        encodingProperties = Windows.Media.MediaProperties.ImageEncodingProperties.createPng();
+                    } else {
+                        fileName = 'photo.jpg';
+                        encodingProperties = Windows.Media.MediaProperties.ImageEncodingProperties.createJpeg();
+                    }
+
+                    tempFolder.createFileAsync(fileName, generateUniqueCollisionOption).done(function(capturedFile) {
+                        capture.capturePhotoToStorageFileAsync(encodingProperties, capturedFile).done(function() {
+
+                            destroyCameraPreview();
+
+                            // success callback for capture operation
+                            var success = function(capturedfile) {
+                                if (destinationType == Camera.DestinationType.FILE_URI || destinationType == Camera.DestinationType.NATIVE_URI) {
+                                    if (targetHeight > 0 && targetWidth > 0) {
+                                        resizeImage(capturedfile);
+                                    } else {
+                                        capturedfile.copyAsync(Windows.Storage.ApplicationData.current.localFolder, capturedfile.name, generateUniqueCollisionOption).done(function(copiedfile) {
+                                            successCallback("ms-appdata:///local/" + copiedfile.name);
+                                        }, errorCallback);
+                                    }
+                                } else {
+                                    if (targetHeight > 0 && targetWidth > 0) {
+                                        resizeImageBase64(capturedfile);
+                                    } else {
+                                        Windows.Storage.FileIO.readBufferAsync(capturedfile).done(function(buffer) {
+                                            var strBase64 = Windows.Security.Cryptography.CryptographicBuffer.encodeToBase64String(buffer);
+                                            capturedfile.deleteAsync().done(function() {
+                                                successCallback(strBase64);
+                                            }, function(err) {
+                                                console.error(err);
+                                                successCallback(strBase64);
+                                            });
+                                        }, errorCallback);
+                                    }
+                                }
+                            };
+
+                            if (saveToPhotoAlbum) {
+                                capturedFile.copyAsync(Windows.Storage.KnownFolders.picturesLibrary, capturedFile.name, generateUniqueCollisionOption)
+                                .done(function() {
+                                    success(capturedFile);
+                                }, errorCallback);
+                            } else {
+                                success(capturedFile);
+                            }
+
+
+                        }, function(err) {
+                            destroyCameraPreview();
+                            errorCallback(err);
+                        });
+                    }, function(err) {
+                        destroyCameraPreview();
+                        errorCallback(err);
+                    });
+                };
+
+                try {
+                    createCameraUI();
+                    startCameraPreview();
+                } catch (ex) {
+                    errorCallback(ex);
+                }
+
+            } else {
+
+                var cameraCaptureUI = new Windows.Media.Capture.CameraCaptureUI();
+                cameraCaptureUI.photoSettings.allowCropping = allowCrop;
+
+                if (encodingType == Camera.EncodingType.PNG) {
+                    cameraCaptureUI.photoSettings.format = Windows.Media.Capture.CameraCaptureUIPhotoFormat.png;
+                } else {
+                    cameraCaptureUI.photoSettings.format = Windows.Media.Capture.CameraCaptureUIPhotoFormat.jpeg;
+                }
+
+                // decide which max pixels should be supported by targetWidth or targetHeight.
+                if (targetWidth >= 1280 || targetHeight >= 960) {
+                    cameraCaptureUI.photoSettings.maxResolution = Windows.Media.Capture.CameraCaptureUIMaxPhotoResolution.large3M;
+                } else if (targetWidth >= 1024 || targetHeight >= 768) {
+                    cameraCaptureUI.photoSettings.maxResolution = Windows.Media.Capture.CameraCaptureUIMaxPhotoResolution.mediumXga;
+                } else if (targetWidth >= 800 || targetHeight >= 600) {
+                    cameraCaptureUI.photoSettings.maxResolution = Windows.Media.Capture.CameraCaptureUIMaxPhotoResolution.mediumXga;
+                } else if (targetWidth >= 640 || targetHeight >= 480) {
+                    cameraCaptureUI.photoSettings.maxResolution = Windows.Media.Capture.CameraCaptureUIMaxPhotoResolution.smallVga;
+                } else if (targetWidth >= 320 || targetHeight >= 240) {
+                    cameraCaptureUI.photoSettings.maxResolution = Windows.Media.Capture.CameraCaptureUIMaxPhotoResolution.verySmallQvga;
+                } else {
+                    cameraCaptureUI.photoSettings.maxResolution = Windows.Media.Capture.CameraCaptureUIMaxPhotoResolution.highestAvailable;
+                }
+
+                cameraCaptureUI.captureFileAsync(Windows.Media.Capture.CameraCaptureUIMode.photo).then(function(picture) {
+                    if (picture) {
+                        // save to photo album successCallback
+                        var success = function() {
+                            if (destinationType == Camera.DestinationType.FILE_URI) {
+                                if (targetHeight > 0 && targetWidth > 0) {
+                                    resizeImage(picture);
+                                } else {
+
+                                    var storageFolder = Windows.Storage.ApplicationData.current.localFolder;
+                                    picture.copyAsync(storageFolder, picture.name, Windows.Storage.NameCollisionOption.replaceExisting).then(function(storageFile) {
+                                        successCallback("ms-appdata:///local/" + storageFile.name);
+                                    }, function() {
+                                        errorCallback("Can't access localStorage folder.");
+                                    });
+                                }
+                            } else {
+                                if (targetHeight > 0 && targetWidth > 0) {
+                                    resizeImageBase64(picture);
+                                } else {
+                                    Windows.Storage.FileIO.readBufferAsync(picture).done(function(buffer) {
+                                        var strBase64 = Windows.Security.Cryptography.CryptographicBuffer.encodeToBase64String(buffer);
+                                        successCallback(strBase64);
+                                    });
+                                }
+                            }
+                        };
+                        // save to photo album errorCallback
+                        var fail = function() {
+                            //errorCallback("FileError, code:" + fileError.code);
+                            errorCallback("Save fail.");
+                        };
+
+                        if (saveToPhotoAlbum) {
+                            Windows.Storage.StorageFile.getFileFromPathAsync(picture.path).then(function(storageFile) {
+                                storageFile.copyAsync(Windows.Storage.KnownFolders.picturesLibrary, picture.name, Windows.Storage.NameCollisionOption.generateUniqueName).then(function(storageFile) {
+                                    success();
+                                }, function() {
+                                    fail();
+                                });
+                            });
+                        } else {
+                            success();
+                        }
+                    } else {
+                        errorCallback("User didn't capture a photo.");
+                    }
+                }, function() {
+                    errorCallback("Fail to capture a photo.");
+                });
+            }
+        }
+    }
+};
+
+require("cordova/exec/proxy").add("Camera",module.exports);

http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/6dcfa9cf/src/windows8/CameraProxy.js
----------------------------------------------------------------------
diff --git a/src/windows8/CameraProxy.js b/src/windows8/CameraProxy.js
deleted file mode 100644
index 0924e5c..0000000
--- a/src/windows8/CameraProxy.js
+++ /dev/null
@@ -1,441 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/*global Windows:true, URL:true */
-
-
-    var cordova = require('cordova'),
-        Camera = require('./Camera');
-
-module.exports = {
-
-    // args will contain :
-    //  ...  it is an array, so be careful
-    // 0 quality:50,
-    // 1 destinationType:Camera.DestinationType.FILE_URI,
-    // 2 sourceType:Camera.PictureSourceType.CAMERA,
-    // 3 targetWidth:-1,
-    // 4 targetHeight:-1,
-    // 5 encodingType:Camera.EncodingType.JPEG,
-    // 6 mediaType:Camera.MediaType.PICTURE,
-    // 7 allowEdit:false,
-    // 8 correctOrientation:false,
-    // 9 saveToPhotoAlbum:false,
-    // 10 popoverOptions:null
-    // 11 cameraDirection:0
-
-    takePicture: function (successCallback, errorCallback, args) {
-        var encodingType = args[5];
-        var targetWidth = args[3];
-        var targetHeight = args[4];
-        var sourceType = args[2];
-        var destinationType = args[1];
-        var mediaType = args[6];
-        var allowCrop = !!args[7];
-        var saveToPhotoAlbum = args[9];
-        var cameraDirection = args[11];
-
-        // resize method :)
-        var resizeImage = function (file) {
-            var tempPhotoFileName = "";
-            if (encodingType == Camera.EncodingType.PNG) {
-                tempPhotoFileName = "camera_cordova_temp_return.png";
-            } else {
-                tempPhotoFileName = "camera_cordova_temp_return.jpg";
-            }
-
-            var storageFolder = Windows.Storage.ApplicationData.current.localFolder;
-            file.copyAsync(storageFolder, file.name, Windows.Storage.NameCollisionOption.replaceExisting).then(function (storageFile) {
-                Windows.Storage.FileIO.readBufferAsync(storageFile).then(function(buffer) {
-                    var strBase64 = Windows.Security.Cryptography.CryptographicBuffer.encodeToBase64String(buffer);
-                    var imageData = "data:" + file.contentType + ";base64," + strBase64;
-                    var image = new Image();
-                    image.src = imageData;
-                    image.onload = function() {
-                        var imageWidth = targetWidth,
-                            imageHeight = targetHeight;
-                        var canvas = document.createElement('canvas');
-
-                        canvas.width = imageWidth;
-                        canvas.height = imageHeight;
-
-                        canvas.getContext("2d").drawImage(this, 0, 0, imageWidth, imageHeight);
-
-                        var fileContent = canvas.toDataURL(file.contentType).split(',')[1];
-
-                        var storageFolder = Windows.Storage.ApplicationData.current.localFolder;
-
-                        storageFolder.createFileAsync(tempPhotoFileName, Windows.Storage.CreationCollisionOption.generateUniqueName).done(function (storagefile) {
-                            var content = Windows.Security.Cryptography.CryptographicBuffer.decodeFromBase64String(fileContent);
-                            Windows.Storage.FileIO.writeBufferAsync(storagefile, content).then(function () {
-                                successCallback("ms-appdata:///local/" + storagefile.name);
-                            }, function () {
-                                errorCallback("Resize picture error.");
-                            });
-                        });
-                    };
-                });
-            }, function () {
-                errorCallback("Can't access localStorage folder");
-            });
-
-        };
-
-        // because of asynchronous method, so let the successCallback be called in it.
-        var resizeImageBase64 = function (file) {
-
-            Windows.Storage.FileIO.readBufferAsync(file).done( function(buffer) {
-                var strBase64 = Windows.Security.Cryptography.CryptographicBuffer.encodeToBase64String(buffer);
-                var imageData = "data:" + file.contentType + ";base64," + strBase64;
-
-                var image = new Image();
-                image.src = imageData;
-
-                image.onload = function() {
-                    var imageWidth = targetWidth,
-                        imageHeight = targetHeight;
-                    var canvas = document.createElement('canvas');
-
-                    canvas.width = imageWidth;
-                    canvas.height = imageHeight;
-
-                    var ctx = canvas.getContext("2d");
-                    ctx.drawImage(this, 0, 0, imageWidth, imageHeight);
-
-                    // The resized file ready for upload
-                    var finalFile = canvas.toDataURL(file.contentType);
-
-                    // Remove the prefix such as "data:" + contentType + ";base64," , in order to meet the Cordova API.
-                    var arr = finalFile.split(",");
-                    var newStr = finalFile.substr(arr[0].length + 1);
-                    successCallback(newStr);
-                };
-            });
-        };
-
-        if (sourceType != Camera.PictureSourceType.CAMERA) {
-
-            // TODO: Add WP8.1 support
-            // WP8.1 doesn't allow to use of pickSingleFileAsync method
-            // see http://msdn.microsoft.com/en-us/library/windows/apps/br207852.aspx for details
-            // replacement of pickSingleFileAsync - pickSingleFileAndContinue method
-            // will take application to suspended state and this require additional logic to wake application up
-            if (navigator.appVersion.indexOf('Windows Phone 8.1') >= 0 ) {
-                errorCallback('Not supported');
-                return;
-            }
-
-            var fileOpenPicker = new Windows.Storage.Pickers.FileOpenPicker();
-            fileOpenPicker.suggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.picturesLibrary;
-            if (mediaType == Camera.MediaType.PICTURE) {
-                fileOpenPicker.fileTypeFilter.replaceAll([".png", ".jpg", ".jpeg"]);
-            }
-            else if (mediaType == Camera.MediaType.VIDEO) {
-                fileOpenPicker.fileTypeFilter.replaceAll([".avi", ".flv", ".asx", ".asf", ".mov", ".mp4", ".mpg", ".rm", ".srt", ".swf", ".wmv", ".vob"]);
-            }
-            else {
-                fileOpenPicker.fileTypeFilter.replaceAll(["*"]);
-            }
-
-            fileOpenPicker.pickSingleFileAsync().done(function (file) {
-                if (file) {
-                    if (destinationType == Camera.DestinationType.FILE_URI || destinationType == Camera.DestinationType.NATIVE_URI) {
-                        if (targetHeight > 0 && targetWidth > 0) {
-                            resizeImage(file);
-                        }
-                        else {
-
-                            var storageFolder = Windows.Storage.ApplicationData.current.localFolder;
-                            file.copyAsync(storageFolder, file.name, Windows.Storage.NameCollisionOption.replaceExisting).then(function (storageFile) {
-                                successCallback(URL.createObjectURL(storageFile));
-                            }, function () {
-                                errorCallback("Can't access localStorage folder.");
-                            });
-
-                        }
-                    }
-                    else {
-                        if (targetHeight > 0 && targetWidth > 0) {
-                            resizeImageBase64(file);
-                        } else {
-                            Windows.Storage.FileIO.readBufferAsync(file).done(function (buffer) {
-                                var strBase64 = Windows.Security.Cryptography.CryptographicBuffer.encodeToBase64String(buffer);
-                                successCallback(strBase64);
-                            });
-                        }
-
-                    }
-
-                } else {
-                    errorCallback("User didn't choose a file.");
-                }
-            }, function () {
-                errorCallback("User didn't choose a file.");
-            });
-
-        } else {
-
-            var CaptureNS = Windows.Media.Capture;
-
-            // Check if necessary API available
-            if (!CaptureNS.CameraCaptureUI) {
-                // We are running on WP8.1 which lacks CameraCaptureUI class
-                // so we need to use MediaCapture class instead and implement custom UI for camera
-
-                var capturePreview = null,
-                    captureCancelButton = null,
-                    capture = null,
-                    captureSettings = null;
-
-                var createCameraUI = function () {
-
-                    // Create fullscreen preview
-                    capturePreview = document.createElement("video");
-
-                    // z-order style element for capturePreview and captureCancelButton elts
-                    // is necessary to avoid overriding by another page elements, -1 sometimes is not enough
-                    capturePreview.style.cssText = "position: fixed; left: 0; top: 0; width: 100%; height: 100%; z-order: 999";
-
-                    // Create cancel button
-                    captureCancelButton = document.createElement("button");
-                    captureCancelButton.innerText = "Cancel";
-                    captureCancelButton.style.cssText = "position: fixed; right: 0; bottom: 0; display: block; margin: 20px; z-order: 1000";
-
-                    capture = new CaptureNS.MediaCapture();
-
-                    captureSettings = new CaptureNS.MediaCaptureInitializationSettings();
-                    captureSettings.streamingCaptureMode = CaptureNS.StreamingCaptureMode.video;
-                };
-
-                var startCameraPreview = function () {
-
-                    // Search for available camera devices
-                    // This is necessary to detect which camera (front or back) we should use
-                    var expectedPanel = cameraDirection === 1 ? Windows.Devices.Enumeration.Panel.front : Windows.Devices.Enumeration.Panel.back;
-                    Windows.Devices.Enumeration.DeviceInformation.findAllAsync(Windows.Devices.Enumeration.DeviceClass.videoCapture)
-                    .done(function (devices) {
-                        if (devices.length > 0) {
-                            devices.forEach(function(currDev) {
-                                if (currDev.enclosureLocation.panel && currDev.enclosureLocation.panel == expectedPanel) {
-                                    captureSettings.videoDeviceId = currDev.id;
-                                }
-                            });
-
-                            capture.initializeAsync(captureSettings).done(function () {
-                                // This is necessary since WP8.1 MediaCapture outputs video stream rotated 90 degrees CCW
-                                // TODO: This can be not consistent across devices, need additional testing on various devices
-                                capture.setPreviewRotation(Windows.Media.Capture.VideoRotation.clockwise90Degrees);
-                                // msdn.microsoft.com/en-us/library/windows/apps/hh452807.aspx
-                                capturePreview.msZoom = true;
-                                capturePreview.src = URL.createObjectURL(capture);
-                                capturePreview.play();
-
-                                // Insert preview frame and controls into page
-                                document.body.appendChild(capturePreview);
-                                document.body.appendChild(captureCancelButton);
-
-                                // Bind events to controls
-                                capturePreview.addEventListener('click', captureAction);
-                                captureCancelButton.addEventListener('click', function () {
-                                    destroyCameraPreview();
-                                    errorCallback('Cancelled');
-                                }, false);
-                            }, function (err) {
-                                destroyCameraPreview();
-                                errorCallback('Camera intitialization error ' + err);
-                            });
-                        } else {
-                            destroyCameraPreview();
-                            errorCallback('Camera not found');
-                        }
-                    });
-                };
-
-                var destroyCameraPreview = function () {
-                    capturePreview.pause();
-                    capturePreview.src = null;
-                    [capturePreview, captureCancelButton].forEach(function(elem) {
-                        if (elem /* && elem in document.body.childNodes */) {
-                            document.body.removeChild(elem);
-                        }
-                    });
-                    if (capture) {
-                        capture.stopRecordAsync();
-                        capture = null;
-                    }
-                };
-
-                var captureAction = function () {
-
-                    var encodingProperties,
-                        fileName,
-                        generateUniqueCollisionOption = Windows.Storage.CreationCollisionOption.generateUniqueName,
-                        tempFolder = Windows.Storage.ApplicationData.current.temporaryFolder;
-
-                    if (encodingType == Camera.EncodingType.PNG) {
-                        fileName = 'photo.png';
-                        encodingProperties = Windows.Media.MediaProperties.ImageEncodingProperties.createPng();
-                    } else {
-                        fileName = 'photo.jpg';
-                        encodingProperties = Windows.Media.MediaProperties.ImageEncodingProperties.createJpeg();
-                    }
-
-                    tempFolder.createFileAsync(fileName, generateUniqueCollisionOption).done(function(capturedFile) {
-                        capture.capturePhotoToStorageFileAsync(encodingProperties, capturedFile).done(function() {
-
-                            destroyCameraPreview();
-
-                            // success callback for capture operation
-                            var success = function(capturedfile) {
-                                if (destinationType == Camera.DestinationType.FILE_URI || destinationType == Camera.DestinationType.NATIVE_URI) {
-                                    if (targetHeight > 0 && targetWidth > 0) {
-                                        resizeImage(capturedfile);
-                                    } else {
-                                        capturedfile.copyAsync(Windows.Storage.ApplicationData.current.localFolder, capturedfile.name, generateUniqueCollisionOption).done(function(copiedfile) {
-                                            successCallback("ms-appdata:///local/" + copiedfile.name);
-                                        }, errorCallback);
-                                    }
-                                } else {
-                                    if (targetHeight > 0 && targetWidth > 0) {
-                                        resizeImageBase64(capturedfile);
-                                    } else {
-                                        Windows.Storage.FileIO.readBufferAsync(capturedfile).done(function(buffer) {
-                                            var strBase64 = Windows.Security.Cryptography.CryptographicBuffer.encodeToBase64String(buffer);
-                                            capturedfile.deleteAsync().done(function() {
-                                                successCallback(strBase64);
-                                            }, function(err) {
-                                                console.error(err);
-                                                successCallback(strBase64);
-                                            });
-                                        }, errorCallback);
-                                    }
-                                }
-                            };
-
-                            if (saveToPhotoAlbum) {
-                                capturedFile.copyAsync(Windows.Storage.KnownFolders.picturesLibrary, capturedFile.name, generateUniqueCollisionOption)
-                                .done(function() {
-                                    success(capturedFile);
-                                }, errorCallback);
-                            } else {
-                                success(capturedFile);
-                            }
-
-
-                        }, function(err) {
-                            destroyCameraPreview();
-                            errorCallback(err);
-                        });
-                    }, function(err) {
-                        destroyCameraPreview();
-                        errorCallback(err);
-                    });
-                };
-
-                try {
-                    createCameraUI();
-                    startCameraPreview();
-                } catch (ex) {
-                    errorCallback(ex);
-                }
-
-            } else {
-
-                var cameraCaptureUI = new Windows.Media.Capture.CameraCaptureUI();
-                cameraCaptureUI.photoSettings.allowCropping = allowCrop;
-
-                if (encodingType == Camera.EncodingType.PNG) {
-                    cameraCaptureUI.photoSettings.format = Windows.Media.Capture.CameraCaptureUIPhotoFormat.png;
-                } else {
-                    cameraCaptureUI.photoSettings.format = Windows.Media.Capture.CameraCaptureUIPhotoFormat.jpeg;
-                }
-
-                // decide which max pixels should be supported by targetWidth or targetHeight.
-                if (targetWidth >= 1280 || targetHeight >= 960) {
-                    cameraCaptureUI.photoSettings.maxResolution = Windows.Media.Capture.CameraCaptureUIMaxPhotoResolution.large3M;
-                } else if (targetWidth >= 1024 || targetHeight >= 768) {
-                    cameraCaptureUI.photoSettings.maxResolution = Windows.Media.Capture.CameraCaptureUIMaxPhotoResolution.mediumXga;
-                } else if (targetWidth >= 800 || targetHeight >= 600) {
-                    cameraCaptureUI.photoSettings.maxResolution = Windows.Media.Capture.CameraCaptureUIMaxPhotoResolution.mediumXga;
-                } else if (targetWidth >= 640 || targetHeight >= 480) {
-                    cameraCaptureUI.photoSettings.maxResolution = Windows.Media.Capture.CameraCaptureUIMaxPhotoResolution.smallVga;
-                } else if (targetWidth >= 320 || targetHeight >= 240) {
-                    cameraCaptureUI.photoSettings.maxResolution = Windows.Media.Capture.CameraCaptureUIMaxPhotoResolution.verySmallQvga;
-                } else {
-                    cameraCaptureUI.photoSettings.maxResolution = Windows.Media.Capture.CameraCaptureUIMaxPhotoResolution.highestAvailable;
-                }
-
-                cameraCaptureUI.captureFileAsync(Windows.Media.Capture.CameraCaptureUIMode.photo).then(function(picture) {
-                    if (picture) {
-                        // save to photo album successCallback
-                        var success = function() {
-                            if (destinationType == Camera.DestinationType.FILE_URI) {
-                                if (targetHeight > 0 && targetWidth > 0) {
-                                    resizeImage(picture);
-                                } else {
-
-                                    var storageFolder = Windows.Storage.ApplicationData.current.localFolder;
-                                    picture.copyAsync(storageFolder, picture.name, Windows.Storage.NameCollisionOption.replaceExisting).then(function(storageFile) {
-                                        successCallback("ms-appdata:///local/" + storageFile.name);
-                                    }, function() {
-                                        errorCallback("Can't access localStorage folder.");
-                                    });
-                                }
-                            } else {
-                                if (targetHeight > 0 && targetWidth > 0) {
-                                    resizeImageBase64(picture);
-                                } else {
-                                    Windows.Storage.FileIO.readBufferAsync(picture).done(function(buffer) {
-                                        var strBase64 = Windows.Security.Cryptography.CryptographicBuffer.encodeToBase64String(buffer);
-                                        successCallback(strBase64);
-                                    });
-                                }
-                            }
-                        };
-                        // save to photo album errorCallback
-                        var fail = function() {
-                            //errorCallback("FileError, code:" + fileError.code);
-                            errorCallback("Save fail.");
-                        };
-
-                        if (saveToPhotoAlbum) {
-                            Windows.Storage.StorageFile.getFileFromPathAsync(picture.path).then(function(storageFile) {
-                                storageFile.copyAsync(Windows.Storage.KnownFolders.picturesLibrary, picture.name, Windows.Storage.NameCollisionOption.generateUniqueName).then(function(storageFile) {
-                                    success();
-                                }, function() {
-                                    fail();
-                                });
-                            });
-                        } else {
-                            success();
-                        }
-                    } else {
-                        errorCallback("User didn't capture a photo.");
-                    }
-                }, function() {
-                    errorCallback("Fail to capture a photo.");
-                });
-            }
-        }
-    }
-};
-
-require("cordova/exec/proxy").add("Camera",module.exports);


[10/11] git commit: CB-7461 - Geolocation fails in Camera plugin in iOS 8

Posted by an...@apache.org.
CB-7461 - Geolocation fails in Camera plugin in iOS 8


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/commit/fa30a567
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/tree/fa30a567
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/diff/fa30a567

Branch: refs/heads/master
Commit: fa30a5676028f1240dfd979067fd5110814d055d
Parents: 5c13940
Author: Shazron Abdullah <sh...@apache.org>
Authored: Wed Sep 3 16:48:42 2014 -0700
Committer: Anis Kadri <an...@apache.org>
Committed: Fri Sep 5 11:08:15 2014 -0700

----------------------------------------------------------------------
 plugin.xml          | 5 +++++
 src/ios/CDVCamera.m | 3 +++
 2 files changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/fa30a567/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index c660813..c9276e5 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -143,6 +143,11 @@
          <framework src="AssetsLibrary.framework" />
          <framework src="MobileCoreServices.framework" />
          <framework src="CoreGraphics.framework" />
+         
+         <config-file target="*-Info.plist" parent="NSLocationWhenInUseUsageDescription">
+             <string></string>
+         </config-file>
+                  
      </platform>
 
     <!-- blackberry10 -->

http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/fa30a567/src/ios/CDVCamera.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVCamera.m b/src/ios/CDVCamera.m
index fc1afb4..ac20c39 100644
--- a/src/ios/CDVCamera.m
+++ b/src/ios/CDVCamera.m
@@ -315,6 +315,9 @@ static NSSet* org_apache_cordova_validArrowDirections;
                     NSMutableDictionary *EXIFDictionary = [[controllerMetadata objectForKey:(NSString *)kCGImagePropertyExifDictionary]mutableCopy];
                     if (EXIFDictionary)	[self.metadata setObject:EXIFDictionary forKey:(NSString *)kCGImagePropertyExifDictionary];
                     
+                    if (IsAtLeastiOSVersion(@"8.0")) {
+                        [[self locationManager] performSelector:NSSelectorFromString(@"requestWhenInUseAuthorization") withObject:nil afterDelay:0];
+                    }
                     [[self locationManager] startUpdatingLocation];
                     return;
                 }


[08/11] git commit: CB-4003 - Add config option to not use location information in Camera plugin (and default to not use it)

Posted by an...@apache.org.
CB-4003 - Add config option to not use location information in Camera plugin (and default to not use it)


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/commit/ae228200
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/tree/ae228200
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/diff/ae228200

Branch: refs/heads/master
Commit: ae228200464023cf7fada8d483a3ed647bc864cc
Parents: fa30a56
Author: Shazron Abdullah <sh...@apache.org>
Authored: Wed Sep 3 17:40:20 2014 -0700
Committer: Anis Kadri <an...@apache.org>
Committed: Fri Sep 5 11:08:15 2014 -0700

----------------------------------------------------------------------
 doc/index.md        |  9 ++++++++-
 plugin.xml          |  1 +
 src/ios/CDVCamera.h |  1 +
 src/ios/CDVCamera.m | 36 +++++++++++++++++++++++-------------
 4 files changed, 33 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/ae228200/doc/index.md
----------------------------------------------------------------------
diff --git a/doc/index.md b/doc/index.md
index 8429769..0ca141f 100644
--- a/doc/index.md
+++ b/doc/index.md
@@ -85,6 +85,13 @@ than `DATA_URL`.
 - Windows Phone 7 and 8
 - Windows 8
 
+### Preferences (iOS)
+
+-  __CameraUsesGeolocation__ (boolean, defaults to false). For capturing JPEGs, set to true to get geolocation data in the EXIF header. This will trigger a request for geolocation permissions if set to true.
+
+        <preference name="CameraUsesGeolocation" value="false" />
+
+
 ### Amazon Fire OS Quirks
 
 Amazon Fire OS uses intents to launch the camera activity on the device to capture
@@ -226,7 +233,7 @@ Optional parameters to customize the camera settings.
             FRONT : 1      // Use the front-facing camera
         };
 
-### Amazon Fire OSQuirks
+### Amazon Fire OS Quirks
 
 - Any `cameraDirection` value results in a back-facing photo.
 

http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/ae228200/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index c9276e5..a124ee9 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -126,6 +126,7 @@
              <feature name="Camera">
                  <param name="ios-package" value="CDVCamera" />
              </feature>
+             <preference name="CameraUsesGeolocation" value="false" />
          </config-file>
 
          <js-module src="www/ios/CameraPopoverHandle.js" name="CameraPopoverHandle">

http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/ae228200/src/ios/CDVCamera.h
----------------------------------------------------------------------
diff --git a/src/ios/CDVCamera.h b/src/ios/CDVCamera.h
index 5d4a81d..c2a71ac 100644
--- a/src/ios/CDVCamera.h
+++ b/src/ios/CDVCamera.h
@@ -57,6 +57,7 @@ typedef NSUInteger CDVMediaType;
 @property (assign) bool cropToSize;
 @property (strong) UIView* webView;
 @property (assign) BOOL popoverSupported;
+@property (assign) BOOL usesGeolocation;
 
 @end
 

http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/ae228200/src/ios/CDVCamera.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVCamera.m b/src/ios/CDVCamera.m
index ac20c39..c2409be 100644
--- a/src/ios/CDVCamera.m
+++ b/src/ios/CDVCamera.m
@@ -49,6 +49,13 @@ static NSSet* org_apache_cordova_validArrowDirections;
 
 @synthesize hasPendingOperation, pickerController, locationManager;
 
+
+- (BOOL)usesGeolocation
+{
+    id useGeo = [self.commandDelegate.settings objectForKey:[@"CameraUsesGeolocation" lowercaseString]];
+    return [(NSNumber*)useGeo boolValue];
+}
+
 - (BOOL)popoverSupported
 {
     return (NSClassFromString(@"UIPopoverController") != nil) &&
@@ -121,6 +128,7 @@ static NSSet* org_apache_cordova_validArrowDirections;
     // we need to capture this state for memory warnings that dealloc this object
     cameraPicker.webView = self.webView;
     cameraPicker.popoverSupported = [self popoverSupported];
+    cameraPicker.usesGeolocation = [self usesGeolocation];
 
     cameraPicker.correctOrientation = [[arguments objectAtIndex:8] boolValue];
     cameraPicker.saveToPhotoAlbum = [[arguments objectAtIndex:9] boolValue];
@@ -306,20 +314,22 @@ static NSSet* org_apache_cordova_validArrowDirections;
                 data = UIImageJPEGRepresentation(returnedImage, 1.0);
             } else {
                 data = UIImageJPEGRepresentation(returnedImage, cameraPicker.quality / 100.0f);
-
-                NSDictionary *controllerMetadata = [info objectForKey:@"UIImagePickerControllerMediaMetadata"];
-                if (controllerMetadata) {
-                    self.data = data;
-                    self.metadata = [[NSMutableDictionary alloc] init];
-                    
-                    NSMutableDictionary *EXIFDictionary = [[controllerMetadata objectForKey:(NSString *)kCGImagePropertyExifDictionary]mutableCopy];
-                    if (EXIFDictionary)	[self.metadata setObject:EXIFDictionary forKey:(NSString *)kCGImagePropertyExifDictionary];
-                    
-                    if (IsAtLeastiOSVersion(@"8.0")) {
-                        [[self locationManager] performSelector:NSSelectorFromString(@"requestWhenInUseAuthorization") withObject:nil afterDelay:0];
+                
+                if (cameraPicker.usesGeolocation) {
+                    NSDictionary *controllerMetadata = [info objectForKey:@"UIImagePickerControllerMediaMetadata"];
+                    if (controllerMetadata) {
+                        self.data = data;
+                        self.metadata = [[NSMutableDictionary alloc] init];
+                        
+                        NSMutableDictionary *EXIFDictionary = [[controllerMetadata objectForKey:(NSString *)kCGImagePropertyExifDictionary]mutableCopy];
+                        if (EXIFDictionary)	[self.metadata setObject:EXIFDictionary forKey:(NSString *)kCGImagePropertyExifDictionary];
+                        
+                        if (IsAtLeastiOSVersion(@"8.0")) {
+                            [[self locationManager] performSelector:NSSelectorFromString(@"requestWhenInUseAuthorization") withObject:nil afterDelay:0];
+                        }
+                        [[self locationManager] startUpdatingLocation];
+                        return;
                     }
-                    [[self locationManager] startUpdatingLocation];
-                    return;
                 }
             }
             


[09/11] git commit: CB-7433 Fixes manual tests failure on windows

Posted by an...@apache.org.
CB-7433 Fixes manual tests failure on windows


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/commit/5c139405
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/tree/5c139405
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/diff/5c139405

Branch: refs/heads/master
Commit: 5c1394058c558ae6e52016cefbdf2d19731432f9
Parents: 6dcfa9c
Author: Vladimir Kotikov <v-...@microsoft.com>
Authored: Sat Aug 30 01:20:41 2014 +0400
Committer: Anis Kadri <an...@apache.org>
Committed: Fri Sep 5 11:08:15 2014 -0700

----------------------------------------------------------------------
 tests/tests.js | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/5c139405/tests/tests.js
----------------------------------------------------------------------
diff --git a/tests/tests.js b/tests/tests.js
index 48d5ff5..efe424b 100644
--- a/tests/tests.js
+++ b/tests/tests.js
@@ -429,7 +429,16 @@ exports.defineManualTests = function (contentEl, createActionButton) {
             '</p><div id="remove"></div>' +
             'Expected result: Remove image from library.<br>Status box will show "FileEntry.remove success:["OK"]';
 
-    contentEl.innerHTML = info_div + options_div + getpicture_div + test_procedure + inputs_div + actions_div;
+    // We need to wrap this code due to Windows security restrictions
+    // see http://msdn.microsoft.com/en-us/library/windows/apps/hh465380.aspx#differences for details
+    if (MSApp && MSApp.execUnsafeLocalFunction) {
+        MSApp.execUnsafeLocalFunction(function() {
+            contentEl.innerHTML = info_div + options_div + getpicture_div + test_procedure + inputs_div + actions_div;
+        });
+    } else {
+        contentEl.innerHTML = info_div + options_div + getpicture_div + test_procedure + inputs_div + actions_div;
+    }
+
     var elements = document.getElementsByClassName("testInputTag");
     var listener = function (e) {
         testInputTag(e.target);


[04/11] git commit: CB-6958 Get the correct default for "quality" in the test

Posted by an...@apache.org.
CB-6958 Get the correct default for "quality" in the test


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/commit/e9a83495
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/tree/e9a83495
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/diff/e9a83495

Branch: refs/heads/master
Commit: e9a834955c8242b63dc8a84cdb0431fb5eda6b6f
Parents: 5b84c38
Author: Marcel Kinard <cm...@gmail.com>
Authored: Mon Aug 25 15:28:44 2014 -0400
Committer: Anis Kadri <an...@apache.org>
Committed: Fri Sep 5 11:07:49 2014 -0700

----------------------------------------------------------------------
 tests/tests.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/e9a83495/tests/tests.js
----------------------------------------------------------------------
diff --git a/tests/tests.js b/tests/tests.js
index 3388da8..48d5ff5 100644
--- a/tests/tests.js
+++ b/tests/tests.js
@@ -85,7 +85,7 @@ exports.defineManualTests = function (contentEl, createActionButton) {
     var pageStartTime = +new Date();
 
     //default camera options
-    var camQualityDefault = ['quality value', 50];
+    var camQualityDefault = ['50', 50];
     var camDestinationTypeDefault = ['FILE_URI', 1];
     var camPictureSourceTypeDefault = ['CAMERA', 1];
     var camAllowEditDefault = ['allowEdit', false];


[02/11] git commit: Updated docs for browser

Posted by an...@apache.org.
Updated docs for browser


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/commit/a423e57c
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/tree/a423e57c
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/diff/a423e57c

Branch: refs/heads/master
Commit: a423e57c8a42d96684af807d023d592b1c8c64ce
Parents: b2403c6
Author: Suraj Pindoria <su...@yahoo.com>
Authored: Thu Sep 4 14:51:24 2014 -0700
Committer: Suraj Pindoria <su...@yahoo.com>
Committed: Thu Sep 4 14:51:24 2014 -0700

----------------------------------------------------------------------
 doc/index.md | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/a423e57c/doc/index.md
----------------------------------------------------------------------
diff --git a/doc/index.md b/doc/index.md
index 027d7be..8429769 100644
--- a/doc/index.md
+++ b/doc/index.md
@@ -78,6 +78,7 @@ than `DATA_URL`.
 - Amazon Fire OS
 - Android
 - BlackBerry 10
+- Browser
 - Firefox OS
 - iOS
 - Tizen
@@ -96,6 +97,10 @@ Android uses intents to launch the camera activity on the device to capture
 images, and on phones with low memory, the Cordova activity may be killed.  In this
 scenario, the image may not appear when the Cordova activity is restored.
 
+### Browser Quirks
+
+Can only return photos as base64-encoded image.
+
 ### Firefox OS Quirks
 
 Camera plugin is currently implemented using [Web Activities](https://hacks.mozilla.org/2013/01/introducing-web-activities/). 


[11/11] git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/cordova-plugin-camera

Posted by an...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/cordova-plugin-camera

Conflicts:
	plugin.xml


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/commit/1ffb14d7
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/tree/1ffb14d7
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/diff/1ffb14d7

Branch: refs/heads/master
Commit: 1ffb14d76497165d5afefe5ff130fd7c146af5a6
Parents: e851960 af56626
Author: Anis Kadri <an...@apache.org>
Authored: Fri Sep 5 11:08:40 2014 -0700
Committer: Anis Kadri <an...@apache.org>
Committed: Fri Sep 5 11:08:40 2014 -0700

----------------------------------------------------------------------

----------------------------------------------------------------------



[05/11] git commit: add documentation for manual tests

Posted by an...@apache.org.
add documentation for manual tests


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/commit/5b84c38a
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/tree/5b84c38a
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/diff/5b84c38a

Branch: refs/heads/master
Commit: 5b84c38a434a2832832100997728310c7440f86c
Parents: a423e57
Author: Edna Morales <ed...@ednas-mbp-2.raleigh.ibm.com>
Authored: Wed Jul 30 13:54:58 2014 -0400
Committer: Anis Kadri <an...@apache.org>
Committed: Fri Sep 5 11:07:49 2014 -0700

----------------------------------------------------------------------
 tests/tests.js | 51 ++++++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 40 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/5b84c38a/tests/tests.js
----------------------------------------------------------------------
diff --git a/tests/tests.js b/tests/tests.js
index 4f36dd1..3388da8 100644
--- a/tests/tests.js
+++ b/tests/tests.js
@@ -392,15 +392,44 @@ exports.defineManualTests = function (contentEl, createActionButton) {
             createOptionsEl('cameraDirection', Camera.Direction) +
             '</div>',
         getpicture_div = '<div id="getpicture"></div>',
+        test_procedure = '<h4>Recommended Test Procedure</h4>' +
+            'Options not specified should be the default value' +
+            '<br>Status box should update with image and info whenever an image is taken or selected from library' +
+            '</p><div style="background:#B0C4DE;border:1px solid #FFA07A;margin:15px 6px 0px;min-width:295px;max-width:97%;padding:4px 0px 2px 10px;min-height:160px;max-height:200px;overflow:auto">' +
+            '<ol> <li>All default options. Should be able to edit once picture is taken and will be saved to library.</li>' +
+            '</p><li>sourceType=PHOTOLIBRARY<br>Should be able to see picture that was just taken in previous test and edit when selected</li>' +
+            '</p><li>sourceType=Camera<br>allowEdit=false<br>saveToPhotoAlbum=false<br>Should not be able to edit when taken and will not save to library</li>' +
+            '</p><li>encodingType=PNG<br>allowEdit=true<br>saveToPhotoAlbum=true<br>cameraDirection=FRONT<br>Should bring up front camera. Verify in status box info URL that image is encoded as PNG.</li>' +
+            '</p><li>sourceType=SAVEDPHOTOALBUM<br>mediaType=VIDEO<br>Should only be able to select a video</li>' +
+            '</p><li>sourceType=SAVEDPHOTOALBUM<br>mediaType=PICTURE<br>allowEdit=false<br>Should only be able to select a picture and not edit</li>' +
+            '</p><li>sourceType=PHOTOLIBRARY<br>mediaType=ALLMEDIA<br>allowEdit=true<br>Should be able to select pics and videos and edit picture if selected</li>' +
+            '</p><li>sourceType=CAMERA<br>targetWidth & targetHeight=50<br>allowEdit=false<br>Do Get File Metadata test below and take note of size<br>Repeat test but with width and height=800. Size should be significantly larger.</li>' +
+            '</p><li>quality=0<br>targetWidth & targetHeight=default<br>allowEdit=false<br>Do Get File Metadata test below and take note of size<br>Repeat test but with quality=80. Size should be significantly larger.</li>' +
+            '</ol></div>',
         inputs_div = '<h2>Native File Inputs</h2>' +
-            '<div>input type=file <input type="file" class="testInputTag"></div>' +
+            'For the following tests, status box should update with file selected' +
+            '</p><div>input type=file <input type="file" class="testInputTag"></div>' +
             '<div>capture=camera <input type="file" accept="image/*;capture=camera" class="testInputTag"></div>' +
             '<div>capture=camcorder <input type="file" accept="video/*;capture=camcorder" class="testInputTag"></div>' +
             '<div>capture=microphone <input type="file" accept="audio/*;capture=microphone" class="testInputTag"></div>',
         actions_div = '<h2>Actions</h2>' +
-            '<div id="actions"></div>';
-
-    contentEl.innerHTML = info_div + options_div + getpicture_div + inputs_div + actions_div;
+            'For the following tests, ensure that an image is set in status box' +
+            '</p><div id="metadata"></div>' +
+            'Expected result: Get metadata about file selected.<br>Status box will show, along with the metadata, "Call to FileEntry.getMetadata success, Call to FileEntry.setMetadata success, Call to FileEntry.getParent success"' +
+            '</p><div id="reader"></div>' +
+            'Expected result: Read contents of file.<br>Status box will show "Got file: {some metadata}, FileReader.readAsDataURL() - length = someNumber"' +
+            '</p><div id="copy"></div>' +
+            'Expected result: Copy image to new location and move file to different location.<br>Status box will show "Call to FileEntry.copyTo success:{some metadata}, Call to FileEntry.moveTo success:{some metadata}"' +
+            '</p><div id="write"></div>' +
+            'Expected result: Write image to library.<br>Status box will show "Call to FileWriter.write success:{some metadata}, Call to FileWriter.truncate success:{some metadata}"' +
+            '</p><div id="upload"></div>' +
+            'Expected result: Upload image to server.<br>Status box may print out progress. Once finished will show "upload complete"' +
+            '</p><div id="draw_canvas"></div>' +
+            'Expected result: Display image using canvas.<br>Image will be displayed in status box under "canvas:"' +
+            '</p><div id="remove"></div>' +
+            'Expected result: Remove image from library.<br>Status box will show "FileEntry.remove success:["OK"]';
+
+    contentEl.innerHTML = info_div + options_div + getpicture_div + test_procedure + inputs_div + actions_div;
     var elements = document.getElementsByClassName("testInputTag");
     var listener = function (e) {
         testInputTag(e.target);
@@ -420,29 +449,29 @@ exports.defineManualTests = function (contentEl, createActionButton) {
 
     createActionButton('Get File Metadata', function () {
         getFileInfo();
-    }, 'actions');
+    }, 'metadata');
 
     createActionButton('Read with FileReader', function () {
         readFile();
-    }, 'actions');
+    }, 'reader');
 
     createActionButton('Copy Image', function () {
         copyImage();
-    }, 'actions');
+    }, 'copy');
 
     createActionButton('Write Image', function () {
         writeImage();
-    }, 'actions');
+    }, 'write');
 
     createActionButton('Upload Image', function () {
         uploadImage();
-    }, 'actions');
+    }, 'upload');
 
     createActionButton('Draw Using Canvas', function () {
         displayImageUsingCanvas();
-    }, 'actions');
+    }, 'draw_canvas');
 
     createActionButton('Remove Image', function () {
         removeImage();
-    }, 'actions');
+    }, 'remove');
 };