ExifTool Forum

ExifTool => Newbies => Topic started by: nmouse on January 26, 2023, 09:14:12 AM

Title: Extracting Metadata from Non-File Source (CLI)
Post by: nmouse on January 26, 2023, 09:14:12 AM
Hi,

Is it possible to extract metadata from a non-file source such as a buffered file in memory using the CLI tool or possibly a Python wrapper?

I've tried using PyExifTool to no success. Trying to access Composite tags in particular.

Thanks
Title: Re: Extracting Metadata from Non-File Source (CLI)
Post by: StarGeek on January 26, 2023, 01:42:44 PM
I'm not sure what you mean by "buffered file in memory"

Using the Perl API, you could write a Perl program which loads a file into a variable and call the exiftool library to process that variable.

You can pipe a file into exiftool for exiftool to process.  See Piping examples (https://exiftool.org/exiftool_pod.html#PIPING-EXAMPLES), especially the cURL example.

If you mean have exiftool access, for example, a Python variable containing a file image, then no.  You would have to pass the data through STDIO or a pipe.
Title: Re: Extracting Metadata from Non-File Source (CLI)
Post by: nmouse on January 26, 2023, 04:22:13 PM
Thank you. I'm in particular dealing with bytes / a byte array in memory (trying to avoid writing a file to disk) and wondered if I could use exiftool on that. Unfortunately I've no experience at all in Perl currently, so would consider that a really last resort.