I will use exiftool for geotagging many pictures using a kml file. Is there any option on command line for tagging only pictures without any existing geotag? I do not find any information about it.
I would simply check to see if there already was a Latitude (or Longitude) by adding -if "not $GPSLatitude" to your command.
Change double quotes to single quotes if you're on Mac/Linux.
Another option would be to instead add -wm cg. That means that exiftool will not try to overwrite tags that already have data.
Related
I am looking to use exiftool to add modification date. I want to do something like exiftool if not modificationsdate thwn write date not. How to would do this?
Find a file that has your "modificationsdate" already set. Use exiftool FAQ #3 to figure out the exact name of that tag. You would then use exiftool's -if option to check to see if the tag exists or not.
exiftool -if "not $TAG" <RestOfCommand>
Replace TAG with the actual tag name you found from above.
If this command is run under Linux/Mac/Powershell, swap the double for single quotes to avoid the dollar sign as being interpreted as the start of a shell variable.
I have a bunch of old folders containing photos from 2000s.
For an unknown reason photos are empty of Exif data.
But I want, at least, to keep the dates of each photo. So that they are in order when I import them in iCloud Photos.
Is there a software, or in command line way, or a script in any programming language, able to take each date inside 'file properties' and insert it in the photos' Exif data?
Thanks in advance.
You should be able to do this with exiftool. Make a backup of your files first, then try this on a single file:
exiftool "-alldates<filecreatedate" ONEIMAGE.jpg
Then check your "file properties" that you refer to and also check with:
exiftool ONEIMAGE.jpg
If that all looks correct, you can do all files in a directory like this:
exiftool "-alldates<filecreatedate" DIRECTORYNAME
Is is possible to extract previews in batch (from images in a folder) and name the preview using the image's inode?
Example output:
path/to/previews_folder/{image_parent_folder_inode}/{image_inode}.jpg
Your question is a bit unclear, but if you are asking if exiftool can directly access inodes, then the answer is no. Exiftool does have it's FileName and Directory pseudo-tags which can be accessed and manipulated.
In Eclipse (CDT), is there a way to find all occurrences of a string in a single file? I can search the entire workspace easily enough using Ctrl-H, and can do "find-next" using Ctrl-F, but I want to be able to see a list of all matches for just one file.
It would be possible to do by setting up a custom file filter for each file I want to search, but that's very clunky. Eclipse should be able to work out which file I have open and just search that file.
This seems like it should be easy, but I can't find an appropriate option...does it exist?
Use CTRL+H and switch to File Search as you already mentioned, but set Scope to Selected resources. Now you can either search the current file, or selected multiple files and search all of them
I am quite stuck; I need to compress the content of a folder, where I have multiple files (extension .dat). I went for shell scripting.
So far I told myself that is not that hard: I just need to recursively read the content of the dir, get the name of the file and zip it, using the name of the file itself.
This is what I wrote:
for i in *.dat; do zip $i".zip" $i; done
Now when I try it I get a weird behavior: each file is called like "12/23/2012 data102 test1.dat"; and when I run this sequence of commands; I see that zip instead of recognizing the whole file name, see each part of the string as single entity, causing the whole operation to fail.
I told myself that I was doing something wrong, and that the i variable was wrong; so I have replaced echo, instead than the zip command (to see which one was the output of the i variable); and the $i output is the full name of the file, not part of it.
I am totally clueless at this point about what is going on...if the variable i is read by zip it reads each single piece of the string, instead of the whole thing, while if I use echo to see the content of that variable it gets the correct output.
Do I have to pass the value of the filename to zip in a different way? Since it is the content of a variable passed as parameter I was assuming that it won't matter if the string is one or has spaces in it, and I can't find in the man page the answer (if there is any in there).
Anyone knows why do I get this behavior and how to fix it? Thanks!
You need to quote anything with spaces in it.
zip "$i.zip" "$i"
Generally speaking, any variable interpolation should have double quotes unless you specifically require the shell to split it into multiple tokens. The internal field separator $IFS defaults to space and tab, but you can change it to make the shell do word splitting on arbitrary separators. See any decent beginners' shell tutorial for a detailed account of the shell's quoting mechanisms.