Compatible with Apple M1 Max Silicon - Ventura 13.5.1 - Batch Change Dates

Started by magickbox, September 11, 2023, 01:08:03 AM

Previous topic - Next topic

magickbox

I'm looking to do batch changing of dates for Apple Photos images to revert files to original creation dates. I only see info about Intel chip compatibility so wanted to know if ExifTool is compatible with Apple M1 Max Silicon running Ventura 13.5.1.

Also, I saw in the documentation that you don't necessarily have to install ExifTool in order to run it on Mac but I'm unclear how to do that.

If it needs to be installed, do you recommend the MacOS Package or the Full Perl Distribution? Originally I did try to do the MacOS install but got the unidentified developer warning. I imagine if I need to install it that I will need to override that in System Prefs, correct?

Lastly, the steps I was advised to follow to batch change the photos was to drag them into a folder, open Terminal, type cd, space, drag the folder in, press enter and then:

exiftool "-FileModifyDate<DateTimeOriginal" *
press enter

Any help would be greatly appreciated. Thank you.
Rob

wywh

I have always installed and updated exiftool with the MacOS Package .dmg for the basic commands. I believe it works also on Silicon Macs so just try it. Very rarely I have downloaded some extra add-ons to try them (i.e. add-ons like xmp2exif.args, xmp2iptc.args, gpx.fmt put in the same folder as the images and movies so exiftool can use them).

In macOS 10.8 or later, you may see this message when you try to open the install package:

"ExifTool-12.65.pkg" can't be opened because it is from an unidentified developer.

The solution is to control-click on the pkg then select "Open" from the pop-up menu instead of just double-clicking.

To set just the image file dates try this:

exiftool '-FileCreateDate<DateTimeOriginal' '-FileModifyDate<DateTimeOriginal' .
The dot at the end means "this folder". For movies use CreateDate instead DateTimeOriginal.

In macOS the command asks for Xcode Command Line Tools install which can be ignored but then the FileCreateDate moves only backwards in time (the install is quite small and fast, not the huge Xcode install).

When troubleshooting incorrect sorting in some app, you can check all dates with:

exiftool -a -G1 -s -fileOrder5 FileName -api LargeFileSupport=1 -api QuickTimeUTC=1 -FileCreateDate -Time:All .
- Matti

magickbox

Thanks Matti. Couple of questions...

1. Are you suggesting to use both the "FileCreateDate" and "FileModifyDate" commands together as written? Do I need the create date as well as the modify date if I just want the file to revert to its original creation date?

2. Is it a dot (period) or an asterisk? I think I was originally given the asterisk. And then just drag the folder into Terminal?

3. Will Terminal prompt me to install the Xcode Command Line Tools and automatically download or do I have to find that separately. I'm having trouble finding it right now on the Apple Developer site. I just see the full Xcode 15 package and where it says command line should be software downloads, I only see OS versions and betas.

4. If I don't use the command line tools, what do you mean by "then the FileCreateDate moves only backwards in time."

5. Not sure what you mean by "incorrect sorting."

Thanks again for all your suggestions.

- Rob

wywh

Quote from: magickbox on September 11, 2023, 02:04:40 PMCouple of questions...

1. Yes. I understood you wanted to set the file creation & modification dates the same as the internal metadata date.

2. I use a dot (period) to say "this folder". Usually I put just the similar files (.jpg and maybe other images) I want to process in the same folder (and often have a backup copy elsewhere if I mess things up). But sometimes when there are other files such as movies (.mp4 etc) I might add something like '-ext jpg' to the command to process only the images. But sometimes when I am lazy and almost know what I am doing and have good backups, I do use the wildcard asterix like 2023-09*

https://exiftool.org/mistakes.html#M2

There are only a few Terminal commands I use (Google search for more info):

ls -- list directory contents
cd [some folder] -- change directory
cd .. -- change to upper folder
pwd -- show working directory
[arrow up] -- repeat some last command
[tab] -- fill in partially typed command
[cmd-K] -- clear Terminal window

3. The Terminal should automatically prompt and then download & install the "setfile" app. But sometimes Apple's servers act up and those tools can be downloaded manually (I always get the latest non-beta):

https://developer.apple.com/download/more/

4. If the internal metadata date DateTimeOriginal is year 2000 but the FileCreateDate and FileModifyDate are at 1988, then FileCreateDate is stuck at 1988 and only FileModifyDate is moved to 2000. Installing Xcode Command Line Tools fixes that.

5. Many apps (Photos.app, Google Photos etc) might incorrectly sort images and movies so year 2000 is before 1988. Usually this is caused by missing or conflicting internal metadata dates, timezone or location issues, or just that the app decides to grab the wrong date when the correct should be readily available.

- Matti


StarGeek

Quote from: magickbox on September 11, 2023, 01:08:03 AMI only see info about Intel chip compatibility so wanted to know if ExifTool is compatible with Apple M1 Max Silicon running Ventura 13.5.1.

Exiftool is a Perl program, so as long as you have Perl installed, it doesn't matter chip set, as long as it has standard Perl libraries.

QuoteAlso, I saw in the documentation that you don't necessarily have to install ExifTool in order to run it on Mac but I'm unclear how to do that.

It means that if you have Perl, then you can just unpack the Full Perl Distribution, add that directory to the PATH env variable, and run it from there.

I also recommend installing 12.64 rather than 12.65, as there is a minor bug in 12.65 that might not give the full results.  Just copy the distribution you want from the main page and change the 65 in the URL to 64.  For example, the main package
https://exiftool.org/Image-ExifTool-12.64.tar.gz
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

magickbox

Thank you! Sorry for my lack of knowledge here. I'm not a coder and my Xcode experience is minimal and something I haven't attempted in years.

I was having trouble finding it from the developer page but finally found a non-beta version: Command Line Tools for Xcode 14.3.1.

Is Perl included in the Xcode Command Line tools installation?

Also, when you say...
Quote from: StarGeek on September 11, 2023, 06:26:46 PMIt means that if you have Perl, then you can just unpack the Full Perl Distribution, add that directory to the PATH env variable, and run it from there.

...does that mean that when I'm in Terminal, I drag the Image-ExifTool-12.64 folder into the window and then run the change date command?

Thanks again.
Rob

wywh

As I said, I'd recommend installing exiftool from the MacOS Package .dmg so you don't have to think the paths. Just open the .dmg, control-click (or right-click) exiftool installer inside to bypass the missing certificate nag (exiftool is from a trusted source so you can do that).

You need Xcode Command Line tools if you want to change the file dates back and forth as you asked in your initial post. You already have Perl so don't worry about it.

Make good backups (just in case) and try the basic Terminal commands I mentioned above.

- Matti

magickbox

Thanks Matti. When you say I already have Perl, do you mean the Command Line Tools for Xcode 14.3.1. I haven't installed it yet because I wanted to make sure. Or are you saying that my computer would already have perl installed? Thanks again.

Rob

Phil Harvey

MacOS systems should have Perl installed (although at some point they will probably drop it because Apple isn't particularly concerned about backward compatibility).

Type "perl -v" in a Terminal window to see if you have Perl and what version you are running.

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

magickbox

Thanks Phil. Yes looks like it's there.

This is perl 5, version 30, subversion 3 (v5.30.3) built for darwin-thread-multi-2level
Thank you. Will install Xcode tools and see how it all works.

Rob

magickbox

#11
Hi Phil. Revisiting this thread because I'm finally getting around to delving further into this. I did check perl in Terminal and got this today: This is perl 5, version 34, subversion 1 (v5.34.1) built for darwin-thread-multi-2level (with 2 registered patches, see perl -V for more detail).

I installed ExifTool 12.84 Mac OS package. I'm not sure I understand how to identify the folder I want to change the dates in. I entered
exiftool '-FileCreateDate<DateTimeOriginal' '-FileModifyDate<DateTimeOriginal' .
in Terminal and dragged the folder file from the path at the bottom of its window and get an error saying it didn't work. No files changed and I think it didn't recognize the folder. How do I ID the folder after the dot?

Also, fyi, when installing, I did get an alert saying it would not be compatible with future versions of the Mac OS. I'm currently on Sonoma 14.4.1. Thanks again.

Rob

StarGeek

The dot means to process the current directory.  If you want to process a different directory, remove the dot and replace it with the other directory.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).