mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Made changes to ensure that when attempting to upload multiple images, the GPS data is extracted and attached correctly.
This commit is contained in:
parent
6a9428f1fe
commit
387813e1e7
1 changed files with 12 additions and 1 deletions
|
|
@ -23,6 +23,7 @@ import java.io.IOException;
|
|||
import java.nio.channels.FileChannel;
|
||||
import java.util.Date;
|
||||
|
||||
import fr.free.nrw.commons.CommonsApplication;
|
||||
import timber.log.Timber;
|
||||
|
||||
public class FileUtils {
|
||||
|
|
@ -97,10 +98,15 @@ public class FileUtils {
|
|||
}
|
||||
// File
|
||||
else if ("file".equalsIgnoreCase(uri.getScheme())) {
|
||||
<<<<<<< HEAD
|
||||
returnPath = uri.getPath();
|
||||
}
|
||||
|
||||
if(returnPath == null) {
|
||||
=======
|
||||
return uri.getPath();
|
||||
} else {
|
||||
>>>>>>> Made changes to ensure that when attempting to upload multiple images, the GPS data is extracted and attached correctly.
|
||||
//fetching path may fail depending on the source URI and all hope is lost
|
||||
//so we will create and use a copy of the file, which seems to work
|
||||
String copyPath = null;
|
||||
|
|
@ -108,7 +114,10 @@ public class FileUtils {
|
|||
ParcelFileDescriptor descriptor
|
||||
= context.getContentResolver().openFileDescriptor(uri, "r");
|
||||
if (descriptor != null) {
|
||||
<<<<<<< HEAD
|
||||
|
||||
=======
|
||||
>>>>>>> Made changes to ensure that when attempting to upload multiple images, the GPS data is extracted and attached correctly.
|
||||
SharedPreferences sharedPref = PreferenceManager
|
||||
.getDefaultSharedPreferences(CommonsApplication.getInstance());
|
||||
boolean useExtStorage = sharedPref.getBoolean("useExternalStorage", true);
|
||||
|
|
@ -135,10 +144,12 @@ public class FileUtils {
|
|||
Timber.w(e, "Error in file " + copyPath);
|
||||
return null;
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
} else {
|
||||
return returnPath;
|
||||
=======
|
||||
>>>>>>> Made changes to ensure that when attempting to upload multiple images, the GPS data is extracted and attached correctly.
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue