Large number of photos with wrong dates

Bulk Rename Utility How-To's

Large number of photos with wrong dates

Postby pedronery » Fri Dec 22, 2023 2:25 pm

Hi everyone,

I'm currently dealing with a situation involving my NAS 223j (Synology), which houses approximately 15 thousand family pictures and videos. Strangely, around 1 thousand of them seem to be incorrectly sorted under a single date (10/12/2023). I suspect this may have occurred during the process of copying them from Google Photos to my PC and then to the NAS.

I recently discovered Bulk Rename Utility as a potential solution, but I find its numerous features a bit overwhelming. Could someone with experience using this tool kindly provide a screenshot or step-by-step guidance on how to configure the settings? Specifically, I'm looking to replace the incorrect date on these pictures with the oldest date available in their metadata/exifdata.

Your assistance is greatly appreciated.
pedronery
 
Posts: 1
Joined: Fri Dec 22, 2023 2:18 pm

Re: Large number of photos with wrong dates

Postby therube » Wed Dec 27, 2023 5:29 pm

I don't know that BRU can select from "the oldest date available in their metadata/exifdata".
But it should be able to select one of the EXIF data fields & use that to rename the files.

What settings have you tried?
therube
 
Posts: 1446
Joined: Mon Jan 18, 2016 6:23 pm

Re: Large number of photos with wrong dates

Postby sbennet1 » Sat Nov 08, 2025 11:47 pm

pedronery wrote:Hi everyone,

Specifically, I'm looking to replace the incorrect date on these pictures with the oldest date available in their metadata/exifdata.

Your assistance is greatly appreciated.


Has anyone figured out how to do this (find the oldest date available in the metadata/Exif data)?
I have just started to write a javascript program to do this.
If someone has done this already this I would appreciate it if you could share with me how you did it.

Any help would be appreciated.

Steve Bennetts
sbennet1
 
Posts: 2
Joined: Mon Oct 27, 2025 1:55 pm

Re: Large number of photos with wrong dates

Postby Admin » Sun Nov 09, 2025 5:09 am

You can use: https://bulkrename.software/js/

"Find the oldest date available in the metadata/Exif data and apply it as date modified to the file"

Code: Select all
// Example:
// name = "IMG_001.JPG"
// Metadata dates found: DateTimeOriginal = 2020-03-10T08:30:00Z, DateTimeDigitized = 2020-03-12T10:45:00Z, exif("taken") = 2020-03-11T09:15:00Z
// Oldest metadata date = 2020-03-10T08:30:00Z
// Result: file modified timestamp is set to that oldest date; file name remains "IMG_001.JPG"

// Collect possible EXIF dates into an array
var dates = [];
var dt;

// EXIF original date/time
dt = filePropertyDate("exif:DateTimeOriginal");
if (dt) dates.push(dt);

// EXIF digitized date/time
dt = filePropertyDate("exif:DateTimeDigitized");
if (dt) dates.push(dt);

// EXIF image datetime
dt = filePropertyDate("exif:DateTime");
if (dt) dates.push(dt);

// exif() shortcut for "taken" date/time
dt = exif("taken");
if (dt) dates.push(dt);

// If any dates found, find the earliest and assign to newModified
if (dates.length > 0) {
    var oldest = dates[0];
    for (var i = 1; i < dates.length; i++) {
        if (dates[i] < oldest) {
            oldest = dates[i];
        }
    }
    // Set the file's modified timestamp to the oldest metadata date
    newModified = oldest;
}

// Leave newName untouched so the filename is unmodified (defaults to `name`)
Admin
Site Admin
 
Posts: 3099
Joined: Tue Mar 08, 2005 8:39 pm


Return to How-To