ExifTool Forum

ExifTool => Bug Reports / Feature Requests => Topic started by: ryerman on May 21, 2013, 12:54:32 AM

Title: Apply advanced formatting to multiple files
Post by: ryerman on May 21, 2013, 12:54:32 AM
I am trying to use an advanced formatting expression with the -p option, for multiple files.
The command line I'm using seems to apply the formatting expression to only 1 file.

How can the -p option, modified by a formatting expression, be applied to multiple files with the same command line?


Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
Active code page: 1252

F:\>exiftool -ver
9.29

F:\>exiftool -p $filesize file1.jpg file2.jpg
89 kB
105 kB
    2 image files read

F:\>exiftool -p "${filesize;s/kB/kilobytes/}" file1.jpg file2.jpg
89 kilobytes
    2 image files read
89 kilobytes
F:\>


Thanks,
Jim
Title: Re: Apply advanced formatting to multiple files
Post by: Phil Harvey on May 21, 2013, 07:15:12 AM
Hi Jim,

But it did work for both files.

You may be confused because it seems that stderr is getting flushed before stdout, so the "2 image files read" line comes out of sequence.

- Phil
Title: Re: Apply advanced formatting to multiple files
Post by: ryerman on May 21, 2013, 08:41:51 AM
Hi Phil.

I am confused.
file1.jpg is 89 kB and file2.jpg is 105 kB.  I showed this in my previous example.
If the "2 image files read" line is merely out of sequence, I expect this:

F:\>exiftool -p "${filesize;s/kB/kilobytes/}" file1.jpg file2.jpg
89 kilobytes
    2 image files read
105 kilobytes

Here's another example:
F:\>exiftool -p "$filename    ${filesize;s/kB/kilobytes/}" file1.jpg file2.jpg
file1.jpg    89 kilobytes
    2 image files read
89 kilobytes
F:\>


Why is the filename and filesize for file2.jpg not shown in the output?

Thanks,
Jim
Title: Re: Apply advanced formatting to multiple files
Post by: Phil Harvey on May 21, 2013, 08:49:54 AM
Hi Jim,

Ooops.  I totally missed that.

Weird.

I'll look into this.

- Phil
Title: Re: Apply advanced formatting to multiple files
Post by: Phil Harvey on May 21, 2013, 08:57:06 AM
Good catch!  That was a bug.  It will be fixed in 9.30.

The fix also fixes the ordering problem in the output.

Thanks for pointing this out!

- Phil
Title: Re: Apply advanced formatting to multiple files
Post by: ryerman on May 21, 2013, 09:10:00 AM
Thank you Phil.

Adding the advanced formatting functionality was a great idea.  I'll look forward to the fix.

Thanks again for the outstanding support.

Jim
Title: Re: Apply advanced formatting to multiple files
Post by: ryerman on May 25, 2013, 11:56:04 AM
The fix is in.
Advanced formatting worked correctly for multiple files in ver 9.30.

Thanks
Title: Re: Apply advanced formatting to multiple files
Post by: Phil Harvey on May 25, 2013, 12:42:29 PM
Hi Jim,

Glad it worked.  Thanks for the confirmation.

- Phil