diff --git a/README.md b/README.md index 4c92e77..0639ce4 100644 --- a/README.md +++ b/README.md @@ -135,8 +135,31 @@ To add these entries into the `info.plist`, you can use the `edit-config` tag in ### camera.getPicture(successCallback, errorCallback, options) Takes a photo using the camera, or retrieves a photo from the device's -image gallery. The image is passed to the success callback as a -Base64-encoded `String`, or as the URI for the image file. +image gallery. The result is provided in the first parameter of the `successCallback` as a string. + +As of v8.0.0, the result is formatted as URIs. The scheme will vary depending on settings and platform. + +|Platform|Destination Type|Format| +|---|---|---| +|Android|FILE_URI|An URI scheme such as `file://...` or `content://...`| +||DATA_URL|Base 64 encoded with the proper data URI header| +|iOS|FILE_URI|`file://` schemed paths| +||DATA_URL|Base 64 encoded with the proper data URI header| +|Browser|FILE_URI|Not supported| +||DATA_URL|Base 64 encoded with the proper data URI header| + +v7 and earlier versions, the return format is as follows: + +|Platform|Destination Type|Format| +|---|---|---| +|Android|FILE_URI|Raw file path (unprefixed)| +||DATA_URL|Base 64 encoded, without the `data:` prefix +|iOS|FILE_URI|`file://` schemed paths| +||DATA_URL|Base 64 encoded, without the `data:` prefix +|Browser|FILE_URI|Not supported| +||DATA_URL|Base 64 encoded, without the `data:` prefix| + +For this reason, upgrading to v8 is strongly recommended as it greatly streamlines the return data. The `camera.getPicture` function opens the device's default camera application that allows users to snap pictures by default - this behavior occurs, @@ -149,16 +172,10 @@ that allows users to select an existing image. The return value is sent to the [`cameraSuccess`](#module_camera.onSuccess) callback function, in one of the following formats, depending on the specified -`cameraOptions`: +`cameraOptions`. You can do whatever you want with content: -- A `String` containing the Base64-encoded photo image. -- A `String` representing the image file location on local storage (default). - -You can do whatever you want with the encoded image or URI, for -example: - -- Render the image in an `` tag, as in the example below -- Save the data locally (`LocalStorage`, [Lawnchair](http://brianleroux.github.com/lawnchair/), etc.) +- Render the content in an `` or `