Included result.type, base64, exif in ImageLibrary API as per docs

This commit is contained in:
Jesper Madsen
2018-03-15 11:49:19 +01:00
parent 52bde4982f
commit 26eb5d5878
2 changed files with 30 additions and 1 deletions

View File

@@ -289,14 +289,37 @@ async () => {
};
async () => {
// Video test
const result = await ImagePicker.launchImageLibraryAsync({
mediaTypes: ImagePicker.MediaTypeOptions.Videos
mediaTypes: ImagePicker.MediaTypeOptions.Videos,
});
if (!result.cancelled) {
result.uri;
result.width;
result.height;
result.duration;
result.type;
}
};
async () => {
// Image test
const result = await ImagePicker.launchImageLibraryAsync({
mediaTypes: ImagePicker.MediaTypeOptions.Images,
base64: true,
aspect: [4, 3],
quality: 1,
exif: true,
});
if (!result.cancelled) {
result.uri;
result.width;
result.height;
result.exif;
result.base64;
result.type;
}
};

View File

@@ -1418,6 +1418,10 @@ export namespace ImagePicker {
uri: string;
width: number;
height: number;
type: 'video' | 'image';
base64?: string;
exif?: object;
duration?: number;
}
type ImageResult = { cancelled: true } | ({ cancelled: false } & ImageInfo);
@@ -1434,6 +1438,8 @@ export namespace ImagePicker {
allowsEditing?: boolean;
aspect?: [number, number];
quality?: number;
base64?: boolean;
exif?: boolean;
mediaTypes?: keyof _MediaTypeOptions;
}