Skip to content

Commit

Permalink
feat(image-picker): add DATA_URL as an option to ImagePicker (#2325)
Browse files Browse the repository at this point in the history
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
};
```
  • Loading branch information
roblouie authored and danielsogl committed Jun 23, 2018
1 parent 9f662b6 commit dd9ba0a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/@ionic-native/plugins/image-picker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dd9ba0a

Please sign in to comment.