Skip to content

Commit

Permalink
safer exif parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
ivpusic committed May 5, 2021
1 parent 9d86ade commit 16eb5e8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,14 @@ static WritableMap extract(String path) throws IOException {

ExifInterface exif = new ExifInterface(path);

GeoDegree geoDegree = new GeoDegree(exif);
if (geoDegree.getLatitude() != null && geoDegree.getLongitude() != null) {
exifData.putDouble("Latitude", geoDegree.getLatitude());
exifData.putDouble("Longitude", geoDegree.getLongitude());
try {
GeoDegree geoDegree = new GeoDegree(exif);
if (geoDegree.getLatitude() != null && geoDegree.getLongitude() != null) {
exifData.putDouble("Latitude", geoDegree.getLatitude());
exifData.putDouble("Longitude", geoDegree.getLongitude());
}
} catch (Exception e) {
e.printStackTrace();
}

for (String attribute : attributes) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-image-crop-picker",
"version": "0.36.1",
"version": "0.36.2",
"description": "Select single or multiple images, with cropping option",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 16eb5e8

Please sign in to comment.