set quality and remove editing

This commit is contained in:
Gleidson Daniel 2022-09-20 20:08:09 -03:00
parent 45183121c7
commit a0887c6d9d
1 changed files with 4 additions and 4 deletions

View File

@ -58,7 +58,7 @@ const pickFromCamera = async (
if (!hasPermission) return null; if (!hasPermission) return null;
const image = await ImagePicker.launchCameraAsync({ const image = await ImagePicker.launchCameraAsync({
mediaTypes: mediaType, mediaTypes: mediaType,
quality: 1, quality: 0.8,
allowsEditing allowsEditing
}); });
if (!image.cancelled) return addAdditionalPropsToFile(image); if (!image.cancelled) return addAdditionalPropsToFile(image);
@ -97,7 +97,7 @@ export async function pickImageFromLibrary({ animatedGif = true }: { animatedGif
try { try {
const image = await ImagePicker.launchImageLibraryAsync({ const image = await ImagePicker.launchImageLibraryAsync({
mediaTypes: ImagePicker.MediaTypeOptions.Images, mediaTypes: ImagePicker.MediaTypeOptions.Images,
quality: animatedGif ? 1 : 0.9, quality: animatedGif ? 1 : 0.8,
base64: true base64: true
}); });
if (!image.cancelled) { if (!image.cancelled) {
@ -111,8 +111,8 @@ export async function pickImageFromLibrary({ animatedGif = true }: { animatedGif
} }
} }
export const pickVideoFromCamera = (allowsEditing = true): Promise<ImagePickerFile | null> => export const pickVideoFromCamera = (allowsEditing = false): Promise<ImagePickerFile | null> =>
pickFromCamera(allowsEditing, ImagePicker.MediaTypeOptions.Videos); pickFromCamera(allowsEditing, ImagePicker.MediaTypeOptions.Videos);
export const pickImageFromCamera = (allowsEditing = true): Promise<ImagePickerFile | null> => export const pickImageFromCamera = (allowsEditing = false): Promise<ImagePickerFile | null> =>
pickFromCamera(allowsEditing, ImagePicker.MediaTypeOptions.Images); pickFromCamera(allowsEditing, ImagePicker.MediaTypeOptions.Images);