having a problem with coding an args-file for EXIFtoolGUI, I would like to
open the following new discussion:
Hello,
to document my scanned slides and negatives, I have created small JPGs for
each of them, into which I enter the relevant tags I have selected with
EXIFtoolGUI as follows:
Copies tags to the selected file(s) from the reference as specified in
line 2
-tagsfromfile
D:/Bildarchiv_temp/SW/%f.jpg
----EXIF----
-EXIF:ImageDescription
-EXIF:Artist
...
This requires the source file (reference) and the destination file have the
same filename. However, for documentation purposes I have different file
names. Of course, I could use e.g. "lupasrename" to make the names
identical, a more elegant way would be to change the code in the args file.
Unfortunately I do not know how to do this.
Is there a way to change the %f in the above code so it contains the correct
name of the input file?
Example:
Files selected in the GUI are named slide0001.tif, etc.
Files with the metadata are named slide0001_L_opt.jpg, etc.
The reason I chose this way is, that the data files to be archived are quite
large (265Mbyte), so copying the tags takes a while. On the small JPGs this
is fast. When done with the JPGs, I could then run the args-file on all the
TIFs to copy the tags.
Many thanks for looking into this!
Hermann-Josef
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
As long as the differences in the filenames are the same, you can directly add the additional data. In your example, you would use
D:/Bildarchiv_temp/SW/%f_L_opt.jpg
That's what would be done with regards to exiftool. But I do not use the ExifToolGui, so I cannot advise anything beyond that.
If this isn't enough to help you, I would suggest opening an issue on the ExifToolGui GitHub page. FrankBijnen is quite responsive to questions about the program.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry, but my example was the wrong way around. I mixed source and destination. I corrected that but it gives me an error. So I will try to contact FrankBijnen via GitHub, as you suggested.
Hermann-Josef
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In your first post, you said that you added the tags to the JPEGs and wanted to copy to the TIFFs. Are you actually trying to copy from the TIFF files to the JPEGs?
If it is the latter, the next question is whether the extra text in the file name is always the same length. In other words, is it always 6 extra characters (the length of _L_opt)?
If so, then you can remove the six extra characters with %-.6f
D:/Bildarchiv_temp/SW/%-.6f.tif
The argument that comes after -TagsFromFile is the source of the tags to be copied, but the %f value will be the names of the target files, which I believe should be the files selected in the GUI.
tl;dr
If you are copying from the TIFF files to the JPEGs, you would use D:/Bildarchiv_temp/SW/%-.6f.tif
If you are copying from the JPEGs to the TIFFs, you would use D:/Bildarchiv_temp/SW/%f_L_opt.jpg
There is one thing to be careful of and that is you do not want to copy all the tags from the JPEG, i.e. you do not want to use -TagsFromFile D:/Bildarchiv_temp/SW/%f_L_opt.jpg -All:All
That is because this command would copy the image width and height from the JPEG into the TIFF. TIFF files are different than JPEGs in that the image width and height are tags in the file and they define how to process the TIFF image. Copying different image size tags will change how the TIFF is displayed, basically corrupting the image.
I believe that this is a command that would safely copy all the tags to the TIFF except for the problem ones. -TagsFromFile D:/Bildarchiv_temp/SW/%f_L_opt.jpg -All:All --EXIF:All -CommonIFD0
This will copy all the tags, except for the EXIF ones, but will include the EXIF tags that won't damage the image. See the Shortcuts tags page for the tags that CommonIFD0 will copy.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
thanks a lot for your detailed instructions. I am sorry for the confusion. Let me try to clarify things ( I also asked Frank on GitHub):
The small JPGs are all tagged (named slide0001.jpg) and I want to copy the tags to the properly processed jpgs, named slide0001_L_opt.jpg (and if this works, also to the very large TIFs for archiving). So the source has the short name and the destination has the "_L_opt" added to the file name.
In practical use (since not all JPGs have a corresponding TIF, I have to use the %f as the destination file name. I used %-.6f to create the short name as follows:
for testing purposes. In the end, there is a long list of tags istead of the tag ImageDescription. So the source is in an other directory than the destination %f.
I get the following error message, which I do not understand at all:
Invalid TAG name: "tagsfromfile E:/Bildbearbeitung/Bildarchiv_Meta/2024_11_18/FN/%-.6f.jpg"
Error: File not found - %f.jpg
<-END-
The last line in the code should specify the destination, as far as I read the documentation.
So I am puzzled.
Frank has just replied on GitHub and asked me to provide screenshots. I will do that.
Hermann-Josef
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The problem there is the quotes. Exiftool is being told to search for a file named "tagsfromfile E:/Bildbearbeitung/Bildarchiv_Meta/2024_11_18/FN/%-.6f.jpg"
Note that %f is not at the end. %f can only be used as part of certain options (such as -TagsFromFile, -srcfile, -w and some others. It can also be used as part of a file rename. But it can't be listed on its own unless the file is named "%f.jpg".
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
in the args there are not quotes. These are only in the error message.
If the %f cannot be used as the destination I have a problem. The destination has to be derived from the source file name, since in the end I want to run this args on a large numebr of files.
I habve sent the screenshot to Frank on GitHub.
Hermann-Josef
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ah. Ok. Then the problem appears to be the second part of that FAQ. They need to be on separate lines. As per the example I gave above. The -TagsFromFile option must be on a line by itself.
Also, there must not be trailing spaces on any of these lines.
The destination has to be derived from the source file name
So, what you want to do inn the GUI is select the files that contain the source tags you want to copy from, and then those will be copied to some other files that are not currently shown in the GUI?
Is there any reason you can't just select those other files?
Otherwise, this would require the use of the -srcfile option. I don't use this option very much, so my command may need to be fixed, depending upon the errors. Plus I'm no longer sure exactly which file has the tags and which does not.
I think the ARGS file would be something like this. You will almost certainly have to adjust the %f variable
Hi,
having a problem with coding an args-file for EXIFtoolGUI, I would like to
open the following new discussion:
Hello,
to document my scanned slides and negatives, I have created small JPGs for
each of them, into which I enter the relevant tags I have selected with
EXIFtoolGUI as follows:
Copies tags to the selected file(s) from the reference as specified in
line 2
-tagsfromfile
D:/Bildarchiv_temp/SW/%f.jpg
----EXIF----
-EXIF:ImageDescription
-EXIF:Artist
...
This requires the source file (reference) and the destination file have the
same filename. However, for documentation purposes I have different file
names. Of course, I could use e.g. "lupasrename" to make the names
identical, a more elegant way would be to change the code in the args file.
Unfortunately I do not know how to do this.
Is there a way to change the %f in the above code so it contains the correct
name of the input file?
Example:
Files selected in the GUI are named slide0001.tif, etc.
Files with the metadata are named slide0001_L_opt.jpg, etc.
The reason I chose this way is, that the data files to be archived are quite
large (265Mbyte), so copying the tags takes a while. On the small JPGs this
is fast. When done with the JPGs, I could then run the args-file on all the
TIFs to copy the tags.
Many thanks for looking into this!
Hermann-Josef
As long as the differences in the filenames are the same, you can directly add the additional data. In your example, you would use
D:/Bildarchiv_temp/SW/%f_L_opt.jpgThat's what would be done with regards to exiftool. But I do not use the ExifToolGui, so I cannot advise anything beyond that.
If this isn't enough to help you, I would suggest opening an issue on the ExifToolGui GitHub page. FrankBijnen is quite responsive to questions about the program.
Thanks a lot for your rapid reply. I certainly will give it a try as soon as possible and will let you know.
Hermann-Josef
Sorry, but my example was the wrong way around. I mixed source and destination. I corrected that but it gives me an error. So I will try to contact FrankBijnen via GitHub, as you suggested.
Hermann-Josef
What was the error that was returned?
In your first post, you said that you added the tags to the JPEGs and wanted to copy to the TIFFs. Are you actually trying to copy from the TIFF files to the JPEGs?
If it is the latter, the next question is whether the extra text in the file name is always the same length. In other words, is it always 6 extra characters (the length of
_L_opt)?If so, then you can remove the six extra characters with
%-.6fD:/Bildarchiv_temp/SW/%-.6f.tifThe argument that comes after
-TagsFromFileis the source of the tags to be copied, but the%fvalue will be the names of the target files, which I believe should be the files selected in the GUI.tl;dr
If you are copying from the TIFF files to the JPEGs, you would use
D:/Bildarchiv_temp/SW/%-.6f.tifIf you are copying from the JPEGs to the TIFFs, you would use
D:/Bildarchiv_temp/SW/%f_L_opt.jpgThere is one thing to be careful of and that is you do not want to copy all the tags from the JPEG, i.e. you do not want to use
-TagsFromFile D:/Bildarchiv_temp/SW/%f_L_opt.jpg -All:AllThat is because this command would copy the image width and height from the JPEG into the TIFF. TIFF files are different than JPEGs in that the image width and height are tags in the file and they define how to process the TIFF image. Copying different image size tags will change how the TIFF is displayed, basically corrupting the image.
I believe that this is a command that would safely copy all the tags to the TIFF except for the problem ones.
-TagsFromFile D:/Bildarchiv_temp/SW/%f_L_opt.jpg -All:All --EXIF:All -CommonIFD0This will copy all the tags, except for the EXIF ones, but will include the EXIF tags that won't damage the image. See the Shortcuts tags page for the tags that
CommonIFD0will copy.Good evening,
thanks a lot for your detailed instructions. I am sorry for the confusion. Let me try to clarify things ( I also asked Frank on GitHub):
The small JPGs are all tagged (named slide0001.jpg) and I want to copy the tags to the properly processed jpgs, named slide0001_L_opt.jpg (and if this works, also to the very large TIFs for archiving). So the source has the short name and the destination has the "_L_opt" added to the file name.
In practical use (since not all JPGs have a corresponding TIF, I have to use the %f as the destination file name. I used %-.6f to create the short name as follows:
-TagsFromFile E:/Bildbearbeitung/Bildarchiv_Meta/2024_11_18/FN/%-.6f.jpg
-EXIF:ImageDescription
%f.jpg
for testing purposes. In the end, there is a long list of tags istead of the tag ImageDescription. So the source is in an other directory than the destination %f.
I get the following error message, which I do not understand at all:
Invalid TAG name: "tagsfromfile E:/Bildbearbeitung/Bildarchiv_Meta/2024_11_18/FN/%-.6f.jpg"
Error: File not found - %f.jpg
<-END-
The last line in the code should specify the destination, as far as I read the documentation.
So I am puzzled.
Frank has just replied on GitHub and asked me to provide screenshots. I will do that.
Hermann-Josef
The problem there is the quotes. Exiftool is being told to search for a file named
"tagsfromfile E:/Bildbearbeitung/Bildarchiv_Meta/2024_11_18/FN/%-.6f.jpg"Quotes are not to be used in an ARGS file (see FAQ #29, "My options don't work in a -@ ARGFILE")
The ARGS file should be something like
Note that
%fis not at the end.%fcan only be used as part of certain options (such as-TagsFromFile,-srcfile,-wand some others. It can also be used as part of a file rename. But it can't be listed on its own unless the file is named "%f.jpg".Hi,
in the args there are not quotes. These are only in the error message.
If the %f cannot be used as the destination I have a problem. The destination has to be derived from the source file name, since in the end I want to run this args on a large numebr of files.
I habve sent the screenshot to Frank on GitHub.
Hermann-Josef
Ah. Ok. Then the problem appears to be the second part of that FAQ. They need to be on separate lines. As per the example I gave above. The
-TagsFromFileoption must be on a line by itself.Also, there must not be trailing spaces on any of these lines.
So, what you want to do inn the GUI is select the files that contain the source tags you want to copy from, and then those will be copied to some other files that are not currently shown in the GUI?
Is there any reason you can't just select those other files?
Otherwise, this would require the use of the
-srcfileoption. I don't use this option very much, so my command may need to be fixed, depending upon the errors. Plus I'm no longer sure exactly which file has the tags and which does not.I think the ARGS file would be something like this. You will almost certainly have to adjust the
%fvariableI'm still not sure why you have to select the files you want to copy from instead of the files you want to copy to, though.
Let's continue the discussion over on the GUI's github (Issue #1001).
Last edit: StarGeek 5 days ago