photostructure / exiftool-vendored.js

Fast, cross-platform Node.js access to ExifTool
https://photostructure.github.io/exiftool-vendored.js/
MIT License
405 stars 37 forks source link

Setting ModifyDate does not work (shows the date when the file was modified by exiftools) #186

Open gltched-usr opened 4 weeks ago

gltched-usr commented 4 weeks ago

Describe the bug When I try to set the ModifyDate it doesnt work, Instead it shows the date when the file was modified by exiftool-vendored

To Reproduce

function updateExifCreateDate(filePath, date){
    try {
        const timestamp = date.toISOString();
        await exiftool.write(filePath, {
            CreateDate: timestamp, // Update the creation date
            ModifyDate: timestamp
        }, ['-overwrite_original']); // Pass the flag as an array of strings
        console.log(`Updated EXIF CreateDate for ${filePath} to ${timestamp}`);
    } catch (error) {
        console.error(`Error updating EXIF CreateDate for ${filePath}:`, error);
    }
};

Windows explorer shows the updated CreateDate but the ModifyDate is the time the file was modified: image

Expected behavior The ModifyDate should be set to the same date as the CreateDate

Environment (please complete the following information):