I have a large folder of .heic files transferred from my iPhone that I need to convert to JPG format for compatibility with other software that can’t read HEIC. However, I’m encountering a problem with the file timestamps.
Every method I’ve tried for converting these files results in the creation of new JPG files with their timestamps, which do not reflect the original photos’ creation and modification dates.
How can I convert these HEIC files to JPG while preserving the original timestamps of each photo?
To convert your HEIC files to JPG while preserving their original timestamps, you can use a two-step process. First, use a tool like FFmpeg or ImageMagick to convert the files. Then, use a script or a command-line tool to copy the original timestamps from the HEIC files to the new JPG files. For instance, in Linux, you can use the touch command with the -r option to replicate the timestamps.
For FFmpeg, you can follow the steps given below:
Launch your command line tool (such as Terminal for MacOS and Linux, or Command Prompt/PowerShell for Windows).
Execute the following FFmpeg command:
ffmpeg -i yourimage.heic newimage.jpg
Here, yourimage.heic should be replaced with the path and name of your HEIC file, and newimage.jpg with the desired path and name for your converted JPG file.
For instance, if you have a file named “example.heic” and you want to convert it to “example.jpg”, you would use:
ffmpeg -i example.heic example.jpg
This instructs FFmpeg to convert example.heic into a JPG file named example.jpg.
Ensure that FFmpeg is installed on your computer before you proceed. If it’s not already installed, you can follow the installation guide:
On Windows, you can use a similar approach. After converting the files, you can use a PowerShell script to copy the timestamps. On Mac, the process is similar, but you would use the touch command in the Terminal. There are also third-party tools available that can automate this process for you.
There are several user-friendly tools available that can convert HEIC files to JPG and preserve the timestamps. These tools often come with a graphical user interface, making them easier to use than command-line tools. Examples include “iMazing HEIC Converter” for Windows and Mac, or “Apowersoft HEIC Converter”. However, always check the settings or options in these tools to ensure they are set to preserve the original timestamps.