Sometimes -p $fileattributes requires -api option, sometimes it doesn't

Started by ryerman, November 25, 2015, 04:15:35 PM

Previous topic - Next topic

ryerman

exiftool -p $fileattributes "F:\file.jpg" gives this:
Warning: [Minor] Tag 'fileattributes' not defined - F:/file.jpg

It seems the following command must be used:
exiftool -q -q -api SystemTags -p $fileattributes "F:\file.jpg"

However, if the command contains an -if option that is true, -p $fileattributes displays as any normal print formatted tag, without using the -api or -q options
Is that a bug, or expected behaviour?

Maybe this behaviour has something to do with this thread:
https://exiftool.org/forum/index.php/topic,6849.0.html

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Windows\system32>exiftool -ver
10.05

C:\Windows\system32>exiftool -p $fileattributes "F:\file.jpg"
Warning: [Minor] Tag 'fileattributes' not defined - F:/file.jpg

C:\Windows\system32>exiftool -api SystemTags -p $fileattributes "F:\file.jpg"
Regular; (none); Archive
Warning: PrintConv FileGroupID: The getgrgid function is unimplemented - F:/file.jpg
Warning: PrintConv FileUserID: The getpwuid function is unimplemented - F:/file.jpg

C:\Windows\system32>exiftool -q -q -api SystemTags -p $fileattributes "F:\file.jpg"
Regular; (none); Archive

C:\Windows\system32>exiftool -if "1==1" -p $fileattributes "F:\file.jpg"
Regular; (none); Archive

C:\Windows\system32>
Windows 10 Home 64 bit, Exiftool v12.61

Phil Harvey

Good point.  I think this is an oversight (but I don't think related to the hidden file thread you referenced).  I'll look into this and post back when I have a solution.

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

Phil Harvey

I can't replicate the behaviour that you observe.  I get this on my system (OS X):

> exiftool -p '$fileattributes' a.jpg
Regular; (none)
> exiftool -ver
10.05


What version of ExifTool are you using?

- Phil

Edit: Ah.  I use a config file that sets the SystemTags option.  This is why I didn't notice this problem before.  I can now reproduce the problem. I'll fix this in the next release.

Edit2: Also, you are correct that it is the same problem as in the other thread (using FileAttributes in the -if argument).

Edit3: ExifTool 10.06 is now available
...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

That's better, but -q -q is still required to avoid warnings.
Is that intended?

C:\Windows\system32>exiftool -ver
10.06

C:\Windows\system32>exiftool -p $fileattributes "F:\File.jpg"
Regular; (none); Archive
Warning: PrintConv FileGroupID: The getgrgid function is unimplemented - F:/File.jpg
Warning: PrintConv FileUserID: The getpwuid function is unimplemented - F:/File.jpg

C:\Windows\system32>exiftool -p $fileattributes "F:\File.jpg" -q -q
Regular; (none); Archive
Windows 10 Home 64 bit, Exiftool v12.61

Phil Harvey

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

Phil Harvey

...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

Yep! Looks like you got it this time. Thank-you :)

C:\Windows\system32>exiftool -ver
10.07

C:\Windows\system32>exiftool -p $fileattributes "F:\1Hold\TEST\hidden attribute"
Regular; (none); Hidden, Archive
Regular; (none); Archive
    1 directories scanned
    2 image files read

C:\Windows\system32>exiftool -if "$fileattributes !~ /Hidden/" -p $fileattributes "F:\1Hold\TEST\hidden attribute"
Regular; (none); Archive
    1 directories scanned
    1 files failed condition
    1 image files read

C:\Windows\system32>exiftool -if "$fileattributes =~ /Hidden/" -p $fileattributes "F:\1Hold\TEST\hidden attribute"
Regular; (none); Hidden, Archive
    1 directories scanned
    1 files failed condition
    1 image files read
Windows 10 Home 64 bit, Exiftool v12.61