Pass the GPSExtractor created in FileProcessor.java back into ShareActivity

This commit is contained in:
misaochan 2018-05-29 19:16:52 +10:00
parent a082f509e7
commit dac6a15e60
2 changed files with 3 additions and 2 deletions

View file

@ -99,7 +99,7 @@ public class FileProcessor implements SimilarImageDialogFragment.onResponse{
* Gets coordinates for category suggestions, either from EXIF data or user location * Gets coordinates for category suggestions, either from EXIF data or user location
* @param gpsEnabled if true use GPS * @param gpsEnabled if true use GPS
*/ */
void getFileCoordinates(boolean gpsEnabled) { GPSExtractor getFileCoordinates(boolean gpsEnabled) {
Timber.d("Calling GPSExtractor"); Timber.d("Calling GPSExtractor");
try { try {
ParcelFileDescriptor descriptor = contentResolver.openFileDescriptor(mediaUri, "r"); ParcelFileDescriptor descriptor = contentResolver.openFileDescriptor(mediaUri, "r");
@ -127,6 +127,7 @@ public class FileProcessor implements SimilarImageDialogFragment.onResponse{
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
Timber.w("File not found: " + mediaUri, e); Timber.w("File not found: " + mediaUri, e);
} }
return imageObj;
} }
/** /**

View file

@ -306,7 +306,7 @@ public class ShareActivity
ContentResolver contentResolver = this.getContentResolver(); ContentResolver contentResolver = this.getContentResolver();
fileObj = new FileProcessor(mediaUri, contentResolver, this); fileObj = new FileProcessor(mediaUri, contentResolver, this);
checkIfFileExists(); checkIfFileExists();
fileObj.getFileCoordinates(locationPermitted); imageObj = fileObj.getFileCoordinates(locationPermitted);
} }
/** /**