react-native-image-crop-picker icon indicating copy to clipboard operation
react-native-image-crop-picker copied to clipboard

Invalid mime type returned for iOS

Open Nirodha26 opened this issue 3 years ago • 4 comments

Version

Tell us which versions you are using:

  • react-native-image-crop-picker v0.36.0
  • react-native v0.61.0

Platform

Tell us to which platform this issue is related

  • iOS

Expected behaviour

Image response object should contain valid details

Actual behaviour

When selected any image with mime type except for following, mime value always returns "image/jpeg"

  • image/jpeg
  • image/png
  • image/gif
  • image/tiff

Example image types to reproduce above issue

  • image/heic
  • image/x-icon

Steps to reproduce

  1. Select an image with mime type "image/x-icon" from gallery using ImagePicker.openPicker.

  2. Check mime value returned in response object.

  3. Mime type will be returned as "image/jpeg"

// stacktrace or any other useful debug info

Attachments

image

Nirodha26 avatar Mar 10 '21 12:03 Nirodha26

Same here.

"react-native-image-crop-picker": "^0.35.0", "react-native": "0.63.3",

luisaverza avatar Apr 02 '21 16:04 luisaverza

Hey @ivpusic This issue still exists. All images mime type are returned as "image/jpeg". Any ideas why that could be? "react-native-image-crop-picker": "^0.35.3", "react-native": "0.63.1",

nishanttatva avatar Feb 04 '22 09:02 nishanttatva

It's related to https://github.com/ivpusic/react-native-image-crop-picker/issues/1656 , init?

wmatyjanomtek avatar Apr 13 '22 12:04 wmatyjanomtek

After trace iOS native code, I found a workaround to get the correct image type. Which is the set multiple: true & maxFiles: 1

ImagePicker.openPicker({
  mediaType: 'photo',
  multiple: true,
  maxFiles: 1,
  includeBase64: true,
}).then((images) => {
  console.log(images);
});

BCT-Barney avatar Dec 12 '23 04:12 BCT-Barney