temporary android fix for image picker issue (#466)
parent
ec0510d1d9
commit
f2f73e414a
|
@ -32,6 +32,8 @@ export async function openPicker(
|
||||||
mediaType,
|
mediaType,
|
||||||
multiple: opts.multiple,
|
multiple: opts.multiple,
|
||||||
maxFiles: opts.maxFiles,
|
maxFiles: opts.maxFiles,
|
||||||
|
forceJpg: true, // ios only
|
||||||
|
compressImageQuality: 0.8,
|
||||||
})
|
})
|
||||||
const toMedia = (item: ImageOrVideo) => ({
|
const toMedia = (item: ImageOrVideo) => ({
|
||||||
mediaType,
|
mediaType,
|
||||||
|
@ -60,7 +62,7 @@ export async function openCamera(
|
||||||
cropperCircleOverlay: opts.cropperCircleOverlay,
|
cropperCircleOverlay: opts.cropperCircleOverlay,
|
||||||
cropping: true,
|
cropping: true,
|
||||||
forceJpg: true, // ios only
|
forceJpg: true, // ios only
|
||||||
compressImageQuality: 1.0,
|
compressImageQuality: 0.8,
|
||||||
})
|
})
|
||||||
return {
|
return {
|
||||||
mediaType,
|
mediaType,
|
||||||
|
@ -85,7 +87,7 @@ export async function openCropper(
|
||||||
freeStyleCropEnabled: opts.freeStyleCropEnabled,
|
freeStyleCropEnabled: opts.freeStyleCropEnabled,
|
||||||
cropperCircleOverlay: opts.cropperCircleOverlay,
|
cropperCircleOverlay: opts.cropperCircleOverlay,
|
||||||
forceJpg: true, // ios only
|
forceJpg: true, // ios only
|
||||||
compressImageQuality: 1.0,
|
compressImageQuality: 0.8,
|
||||||
})
|
})
|
||||||
return {
|
return {
|
||||||
mediaType,
|
mediaType,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import {TouchableOpacity} from 'react-native'
|
import {Platform, TouchableOpacity} from 'react-native'
|
||||||
import {
|
import {
|
||||||
FontAwesomeIcon,
|
FontAwesomeIcon,
|
||||||
FontAwesomeIconStyle,
|
FontAwesomeIconStyle,
|
||||||
|
@ -57,6 +57,10 @@ export function SelectPhotoBtn({
|
||||||
})
|
})
|
||||||
const result = []
|
const result = []
|
||||||
for (const image of items) {
|
for (const image of items) {
|
||||||
|
if (Platform.OS === 'android') {
|
||||||
|
result.push(image.path)
|
||||||
|
continue
|
||||||
|
}
|
||||||
result.push(
|
result.push(
|
||||||
await cropAndCompressFlow(
|
await cropAndCompressFlow(
|
||||||
store,
|
store,
|
||||||
|
|
Loading…
Reference in New Issue