ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: mazeckenrode on March 06, 2023, 01:46:43 PM

Title: Inconsistent JSON export
Post by: mazeckenrode on March 06, 2023, 01:46:43 PM
I have an ExifTool command line configured in Directory Opus to export all metadata for all selected files of whatever type to separate JSON files:

ExifTool -progress -echo "Creating JSON file(s)..." -w %%f.%%e.json -json -struct -G {file$}

{file$} is defined in DOpus as "Filenames only, one at a time", which I believe means that the command is run separately for each selected file.

When I run this command on individual DOCX files, the exported JSON includes FILE, ZIP, XML and XMP data. However, I just ran it with several files of different types selected in DOpus (2 DOCX and 1 PDF), and the DOCX JSONs in this case only contain the XMP data. I can't think of any reason offhand why DOpus could have affected the outcome under this circumstance (and will likely check with its developers next if my inquiry here is fruitless), and just wonder if there's something I'm overlooking or not understanding (eluding me in docs/forum/FAQ, etc.) about ExifTool possibly having a part in it.

I'm also wondering, why is FILE data exported for some file types, but not others?
Title: Re: Inconsistent JSON export
Post by: Phil Harvey on March 06, 2023, 02:16:33 PM
"File" tags should be output for any file you read from disk, unless some option is specified to bypass this (like --file:all).

What command-line parameters is DOpus using when it runs ExifTool?

- Phil
Title: Re: Inconsistent JSON export
Post by: mazeckenrode on March 06, 2023, 02:57:31 PM
Quote from: Phil Harvey on March 06, 2023, 02:16:33 PM"File" tags should be output for any file you read from disk

My bad: I was forgetting that I usually use other, separate command lines for PDF files and for image files, which only export the internal metadata for those.

QuoteWhat command-line parameters is DOpus using when it runs ExifTool?

Should be exactly what you see in my first post, with the actual selected filename(s) substituted for {file$}, one at a time. And I believe I've discovered what the problem was: I was inadvertently running my command specifically for PDF files, which only exports PDF and XMP. My bad again. Sorry to bother you.