Merge pull request #24306 from jhalborg/master

Expo - Included result.type, base64, exif in ImageLibrary API as per docs
This commit is contained in:
Arthur Ozga
2018-03-15 12:22:55 -07:00
committed by GitHub
2 changed files with 30 additions and 1 deletions
+24 -1
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;
}
};
+6
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;
}