Consolidate information messages when using numerous -execute options in ARGFILE

Started by ryerman, March 20, 2012, 01:50:46 AM

Previous topic - Next topic

ryerman

After executing a command line, Exiftool produces a short summary that shows the number of directories scanned and the number of images updated.  I like that feature because I can see if the number of images is different from what I expect. Sometimes a misplaced file is found or a hidden file is exposed.

The same summary is also produced every time the -execute option is encountered in an ArgFile.  When I use an ArgFile that invokes the -execute option a large number of times, there are a corresponding number of summary reports that go quickly down the screen.

Is there some way to consolidate all the individual informational summaries into one consolidated report for the entire ArgFile?
Even better: some method to suppress the individual summaries and show only a consolidated report.

Jim
Windows 10 Home 64 bit, Exiftool v12.61

Phil Harvey

Hi Jim,

The -execute commands are really separate, so currently there is no way to calculate a summary across all -execute commands.

The -q option will avoid the individual summaries, but that doesn't help without the overall summary that you would like.

- 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 ($).

ryerman

Hi Phil,

Quote from: Phil Harvey on March 20, 2012, 07:24:25 AM
The -execute commands are really separate, so currently there is no way to calculate a summary across all -execute commands....

Your use of the word "currently" causes me to hope this will change. :)
Maybe a modification of the -q option to -q NUM where NUM is a code to activate different types of "quietness"

Meanwhile, I will redirect the command window output to a text file and analyze the lines to produce a consolidated report.
But I need to make sure the analysis doesn't capture irrelevant information.

A normal, successful, completion of -execute results in 2 lines: the first contains "directories scanned" and the next contains "image files updated".

If -execute results in anything but a normal, successful completion, are there any other messages (informational, warning, error) that contain those phrases?

Is there some way to see or generate a list of all the possible messages that could be generated?

Thanks,
Jim
Windows 10 Home 64 bit, Exiftool v12.61

Phil Harvey

Hi Jim,

The exiftool source code is available in many places, including all distributions, but perhaps this link is most convenient.

The relevant section of the code is:

    # print summary
    my $tot = $count + $countBad;
    my $totWr = $countGoodWr + $countBadWr + $countSameWr + $countCopyWr +
                $countGoodCr + $countBadCr;
    if ($countDir or $totWr or $countFailed or $tot > 1 or $textOut) {
        my $o = (($html or $json or $xml or %printFmt or $csv) and not $textOut) ? \*STDERR : \*STDOUT;
        printf($o "%5d directories scanned\n", $countDir) if $countDir;
        printf($o "%5d directories created\n", $countNewDir) if $countNewDir;
        printf($o "%5d files failed condition\n", $countFailed) if $countFailed;
        printf($o "%5d image files created\n", $countGoodCr) if $countGoodCr;
        printf($o "%5d image files updated\n", $countGoodWr) if $totWr - $countGoodCr - $countBadCr - $countCopyWr;
        printf($o "%5d image files unchanged\n", $countSameWr) if $countSameWr;
        printf($o "%5d image files copied\n", $countCopyWr) if $countCopyWr;
        printf($o "%5d files weren't updated due to errors\n", $countBadWr) if $countBadWr;
        printf($o "%5d files weren't created due to errors\n", $countBadCr) if $countBadCr;
        printf($o "%5d image files read\n", $count) if $tot>1 or ($countDir and not $totWr);
        printf($o "%5d files could not be read\n", $countBad) if $countBad;
        printf($o "%5d output files created\n", $countCreated) if $textOut;
    }


which shows you all of the possibilities.

- 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 ($).

ryerman

Hi Phil,

Beautiful! That's just what I need.
Thanks again for your time and effort.

Jim
Windows 10 Home 64 bit, Exiftool v12.61