5

The new .HEIC files on IOS 11 is causing problems because image hosting services to not support it.

The camera roll api is returning.HEIC files. How can we get .JPG/.PNG instead. Or convert .HEIC to .JPG/.PNG

Thomas Charlesworth
  • 1,789
  • 5
  • 28
  • 53

1 Answers1

0
ImagePicker.showImagePicker(options, imgResponse => {

this.setState({ imageLoading: true, avatarMediaId: null });

if ((imgResponse.didCancel) || (imgResponse.error)) {
    this.setState({ imageLoading: false });
} else {
    let source = {};
    let fileName = imgResponse.fileName;
    if (Platform.OS === 'ios' && (fileName.endsWith('.heic') || fileName.endsWith('.HEIC'))) {
        fileName = `${fileName.split(".")[0]}.JPG`;
    }
    source = { uri: imgResponse.uri, fileName };
    this.uploadImage(source);
}});
Nag Repala
  • 13
  • 4