Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ import {NativeModules} from 'react-native';

const ImageCropPicker = NativeModules.ImageCropPicker;

const nativeOpenPicker = ImageCropPicker.openPicker;
ImageCropPicker.openPicker = options => {
return nativeOpenPicker(options).then(res => {
(Array.isArray(res) ? res : [res]).forEach(image => {
const gps = image?.exif?.["{GPS}"];
if (gps?.Latitude && gps?.Longitude) {
image.exif.Latitude = gps.LatitudeRef === 'S' ? -gps.Latitude : gps.Latitude;
image.exif.Longitude = gps.LongitudeRef === 'W' ? -gps.Longitude : gps.Longitude;
}
});
return res;
});
}

export default ImageCropPicker;
export const openPicker = ImageCropPicker.openPicker;
export const openCamera = ImageCropPicker.openCamera;
Expand Down