From dd9ba0ad3f462bab4608a74c57c880f37aae6275 Mon Sep 17 00:00:00 2001 From: Rob Date: Sat, 23 Jun 2018 10:14:55 -0500 Subject: [PATCH] feat(image-picker): add DATA_URL as an option to ImagePicker (#2325) As documented in the image picker plugin, it also supports a data url, just like the camera does. However, this option is not documented in Ionic Native currently. I've added this documentation, and have also added an enum with a naming pattern that matches the DestinationType in Camera. Docs from the image picker plugin: ``` ... // output type, defaults to FILE_URIs. // available options are // window.imagePicker.OutputType.FILE_URI (0) or // window.imagePicker.OutputType.BASE64_STRING (1) outputType: int }; ``` --- src/@ionic-native/plugins/image-picker/index.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/@ionic-native/plugins/image-picker/index.ts b/src/@ionic-native/plugins/image-picker/index.ts index 02f265d23..8a061075a 100644 --- a/src/@ionic-native/plugins/image-picker/index.ts +++ b/src/@ionic-native/plugins/image-picker/index.ts @@ -23,11 +23,19 @@ export interface ImagePickerOptions { quality?: number; /** - * Output type, defaults to 0 (FILE_URI). + * Choose the format of the return value. + * Defined in ImagePicker.OutputType. Default is FILE_URI. + * FILE_URI : 0, Return image file URI, + * DATA_URL : 1, Return image as base64-encoded string */ outputType?: number; } +export enum OutputType { + FILE_URL = 0, + DATA_URL +} + /** * @name Image Picker * @description