Main Menu

ExifTool for Android 10

Started by kingvhit, February 04, 2020, 04:08:15 AM

Previous topic - Next topic

kingvhit

Hello Phil,

According to the Android 10, the android 10 is stoped support the absolute path of file on Android. Instead of it, they use SAF (Storage Access Framework) to get the content like (photo, video) file.
https://developer.android.com/about/versions/10/privacy/changes#scoped-storage

It mean, our app can't get the abosolute path of file like before.
The schema of content that I can get of a file maybe like this

content://com.abc.xyz/image/10232

However, they do support File Descriptor, it mean I can get the file descriptor id of that file.

Some tip trick is suggest me to use the path of file descriptor on Android based linux system, and put the fd id into them.
https://stackoverflow.com/questions/57809181/how-to-resolve-android-10s-storage-mess/58304368#58304368

As I tried many time, the exiftool command like this, but it does not found a files.

exiftool -i /proc/self/fd/10232


---
The other research, I found another related issue, they said
File descriptors received from SAF can be used using the pipe protocol. Both input and output files can be defined with pipe protocol. But some file formats require the output to be seekable, so pipe protocol will fail with them. Be careful about them.

Could you help me figerout of it, cause i am not realy a C or Perl programer,

kingvhit

The other way:
Using file descriptor on Linux based to processing with file, but I don't know is it support for Perl or Shell yet or not?

Phil Harvey

Sorry, I don't know anything about this.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

kingvhit

Hi Phil,

I don't have any experience with Perl, but I want to modify some code of the ExifTool to support the input file as the File Descriptor number instead of use absolute file path.
For some reason, I can't use absolute file path for the input files of ExifTool, but I can get the FD number of it.

For some researching, I think Perl already support FD number to open the file instead of using absolute file path.
https://docstore.mik.ua/orelly/perl4/cook/ch07_10.htm

I have to take a deep look on the exiftool script file, but can't see what point that Exiftool open the file based absolute file path.

Phil Harvey

All file open calls go through the ExifTool::Open function.
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).