[Originally posted by photowarrior on 2009-12-12 17:28:33-08]
Hello,
I was wondering if someone could help me. I do a lot of field photography and i often tag photos with the "lock" button on my Nikon D300 camera to pre-process and sort images. It is these images that i focus on first when processing everything.
I am looking for a technique that would allow me to add a tag to the image if it has a read-only file attribute on it. Currently, I use windows to sort by file attributes, drag all of the first files into a folder, do my exiftool processing (adding copyright tags, renaming and moving to photo archives) and then focus on the rest.
I'm looking for a batch file or Exiftool flag that would allow me to do this without the manual sorting first.
Any Suggestions?
J.
[Originally posted by exiftool on 2009-12-12 21:24:18-08]
So when you lock the file with the D300, the only
difference is that the image is read-only after
it is downloaded to your computer? If the file
itself is modified I could extract
the meta information if I had sample images.
Otherwise please give me as much detail as you can
about how the filesystem permissions are changed
and I will see what I can do about extracting these
permissions. If I can do this, then you can test
the value in a -if statement to conditionally
process your files.
- Phil
[Originally posted by photowarrior on 2009-12-13 01:37:13-08]
Hi Phil,
That is correct on the file being "Read-Only". This is only difference (that i have been able to find) between it and a non-tagged/locked file. I have not been able to find any difference in the contents of the file besides the obvious tags that would normally be different. I can provide you a couple of images for examination if you would like to see if there are internal tags
I mostly use the windows version of Exiftool which is the "read only" file attribute. Under Linux, however, the file permissions are 555 for a locked file.
Hope that helps.
J
[Originally posted by exiftool on 2009-12-13 12:44:43-08]OK. I will add a new "FilePermissions" tag to exiftool
8.02 which will allow you to test the permissions with
the
-if option. It will work like this:
> ls -l a.jpg
-rw-r--r-- 1 phil staff 351 13 Dec 08:28 a.jpg
> exiftool a.jpg -filepermissions
File Permissions : Owner:rw- Group:r-- Other:r--
> exiftool a.jpg -filepermissions#
File Permissions : rw-r--r--
> exiftool a.jpg -p '$filename is writable' -if '$filepermissions=~/Owner:.w/'
a.jpg is writable
> chmod 444 a.jpg
> ls -l a.jpg
-r--r--r-- 1 phil staff 351 13 Dec 08:28 a.jpg
> exiftool a.jpg -filepermissions
File Permissions : Owner:r-- Group:r-- Other:r--
> exiftool a.jpg -p '$filename is writable' -if '$filepermissions=~/Owner:.w/'
1 files failed condition
I have tested this and it should work in Windows too
(with double quotes around arguments
instead of single quotes as above).
I hope to release version 8.02 tomorrow.
- Phil
[Originally posted by photowarrior on 2009-12-13 14:03:39-08]Many thanks..
That looks like it would work perfectly.. So to confirm my use of this, i assume my command would be something like this in order to add a Keyword of "FieldTagged" to the image:
exiftool a.jpg -if "$filepermissions=~/Owner:.w/" -keywords=+"FieldTagged"
My compliments on a great piece of software for handling many photographs easily and quickly.
J.
[Originally posted by exiftool on 2009-12-14 00:59:09-08]
Yes. That should work.
- Phil
[Originally posted by exiftool on 2009-12-14 23:50:45-08]I wasn't able to release version 8.02 today, but if I
don't hit any snags I should be able to do this
tomorrow morning.
I think I will use a slightly different format for the
converted values. I was thinking of the following:
> exiftool -filepermissions -filepermissions# test.jpg
File Permissions : Owner:rw- Group:rw- Other:r--
File Permissions : rw-rw-r--
But now I'm thinking of doing this instead:
> exiftool -filepermissions -filepermissions# test.jpg
File Permissions : rw-rw-r--
File Permissions : 664
so the
-if expression would change to:
-if "$filepermissions=~/^.w/"
Unless someone convinces me otherwise I think this is
the way I'll implement it.
- Phil