Save geotagged images to new directory using exiftool - exiftool

I am trying to use exiftool in command line.
By default exiftool saves geotagged image in the same directory where the original image is. Can I change this behavior and change the directory of geotagged image to new directory.

You want to look at the -o option. The second example under Writing Examples shows this option. In your case, it would be something like:
exiftool -GPSLatitude=0.000 -GPSLongitude=0.000 -GPSLatitudeRef=S -GPSLongitudeRef=W -o /path/to/New/GPSTaggedFiles/ /Source/Path/

Related

File Date to Exif Data

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

Extract previews in batch and name preview using inodes?

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.

Edit MP4 Metadata with exiftool

I have an MP4 file with Title metadata:
exiftool movie.mp4
Which gives:
Audio Bits Per Sample : 16
Audio Sample Rate : 48000
Handler Type : Metadata
Handler Vendor ID : Apple
Title : Movie Title
I want to completely remove this Title metadata. I have tried overwriting the title:
exiftool -Title="" movie.mp4
exiftool -Title= movie.mp4
exiftool -Title="" -overwrite_original movie.mp4
The command takes awhile to execute, but exits with:
0 image files updated
1 image files unchanged
What am I doing incorrectly? How can I view what the exiftool error is? How can I remove the Title attribute? According to the man page, MP4 seems to be a supported file type.
Thanks so much for your help!
Since the time of the original question, exiftool, as of ver 11.39, has gained the ability to create/edit a larger range of MP4/MOV metadata tags (see Quicktime tags page). To remove the Title tag from a video the original commands that #James Taylor used will work:
exiftool -Title= movie.mp4
Or in batch with
exiftool -Title= /path/to/files/
These commands creates backup files. Add -overwrite_original to suppress the creation of backup files. Add -r to recurse into subdirectories.
You can also use ffmpeg with a command similar to this, based upon this StackOverflow answer
ffmpeg -i InputFile -c copy -metadata title= OutputFile
But as is, I believe this command will remove all metadata. I think that -map_metadata 0 needs to be added to the command to keep the remaining metadata, but unsure of where.

How do you trim the XMP XML contained within a jpg

Through the use of sanselan I've found that the root cause of iPhone photos imported to windows becoming uneditable is that there is content (white space?) after the actual XML (for more details and a linked example of the bad XMP XML see https://apple.stackexchange.com/questions/45326/why-can-i-not-edit-some-photos-imported-from-an-iphone-to-windows-vista).
I'd like to scan through my photo archive and 'trim' the XMP XML.
Is there an easy way to do this?
I have some java code that can recursively navigate my photo archive and DETECT the issue. I'm not sure how to trim and write the XML back though.
Obtain the existing XML using any means.
The following works if using the Apache Sanselan library:
String xmpXml = Sanselan.getXmpXml(new File('/path/to/jpeg'));
Then trim it...
xmpXml = xmpXml.trim();
Then write it back to the file using the solution to serializing Xmp XML to an existing jpeg.
try the following steps:
collect all of the photos in a single folder (e.g. folder xmlToConvert on your Desktop)
open a Terminal.app window
cd to the directory you put the files in (e.g. cd ~/Desktop/xmlToConvert)
run the following command from your command line prompt
mkdir converted ; for f in *.xml ; do cat $f | head -n $(wc -l $f) > converted/$f ; done
the converted/ sub-directory should now contain all the files without the whitespace at the end.
(i.e. a folder called converted in the xmlToConvert you created on your Desktop)
hth

Can you create custom build rules for XCode based on file type?

I have a project with a bunch of .png files that I want to convert to PVRTC compressed textures. Right now, I'm using a custom XCode run script phase that looks like this:
TEXTURE_TOOL=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/texturetool
$TEXTURE_TOOL -e PVRTC --bits-per-pixel-2 -o "$SRCROOT/images/select_menu_bgs1.pvr" -f PVR "$SRCROOT/images/select_menu_bgs1.png"
$TEXTURE_TOOL -e PVRTC --bits-per-pixel-2 -o "$SRCROOT/images/select_menu_bgs2.pvr" -f PVR "$SRCROOT/images/select_menu_bgs2.png"
but it's annoying to have to make it explicitly include the exact list of files I need converted. (they also need to be added to the input & output properties of the build step, which is the even more annoying part.)
what I would like to do is something easy with "make": have a rule that says "if there's a .pvr in the project, it's built from the corresponding .png using this command line."
Is anything like this possible in XCode?
Double-click a Target.
Choose the Rules pane, simplify it with the popup Rules Specific to target
Click the Plus button at the bottom of the window.
For the Process: popup, choose the last entry - Source files with names matching, which allows you to enter a file glob pattern.
For Using, choose Custom Script and enter your script below.
Use "${INPUT_FILE_BASE}" eg:
$TEXTURE_TOOL -e PVRTC --bits-per-pixel-2 -o "${INPUT_FILE_BASE}.pvr" -f PVR "${INPUT_FILE_BASE}.png"