I got a working script to copy the people data from Picasa-tagged images to people tags that everything can read.
It checks if the tags are different, and if they are it captures the modified time stamp, updates the metadata and then replaces the modified time stamp with the original.
It could be optimized, but it works.
Facetag.bat
It checks if the tags are different, and if they are it captures the modified time stamp, updates the metadata and then replaces the modified time stamp with the original.
It could be optimized, but it works.
Facetag.bat
Code:
@echo offsetlocal enabledelayedexpansionrem Path to exiftoolset "exiftool_path=C:\Exiftool\exiftool.exe"rem Path to colortoolset "colortool_path=C:\ColorTool\ColorTool.exe"rem ANSI escape codes for Colortool colorsset "ansi_red=[31m"set "ansi_green=[32m"set "ansi_reset=[0m"set "ansi_light_blue=[94m"set "ansi_grey=[0m"set "ansi_reset=[0m"rem Check if Colortool existsif not exist "%colortool_path%" ( echo %ansi_red%Colortool not found at %colortool_path%. Please make sure the path is correct.%ansi_reset% exit /b 1)rem Apply Colortool color scheme"%colortool_path%" -b OneHalfDarkrem Check if exiftool existsif not exist "%exiftool_path%" ( echo %ansi_red%Exiftool not found at %exiftool_path%. Please make sure the path is correct.%ansi_reset% exit /b 1)rem Directory containing the scriptset "script_dir=%~dp0"rem Iterate over each photo in the directory and its subdirectoriesfor /r "%script_dir%" %%F in (*.jpg) do ( rem Run command to extract RegionName metadata and save output to a temporary file "%exiftool_path%" -T -XMP-mwg-rs:RegionName "%%F" > "%temp%\region_name.tmp" rem Read contents of the temporary file to capture RegionName metadata set /p region_name=<"%temp%\region_name.tmp" del "%temp%\region_name.tmp" 2>nul rem Debug output echo %ansi_grey%------------------------------------------------------------%ansi_reset% echo File: %%F echo RegionName metadata: %ansi_light_blue%!region_name!%ansi_reset% rem Run command to extract RegionPersonDisplayName metadata and save output to a temporary file "%exiftool_path%" -T -XMP-MP:RegionPersonDisplayName "%%F" > "%temp%\region_display_name.tmp" rem Read contents of the temporary file to capture RegionPersonDisplayName metadata set /p region_display_name=<"%temp%\region_display_name.tmp" del "%temp%\region_display_name.tmp" 2>nul rem Debug output echo RegionPersonDisplayName metadata: %ansi_light_blue%!region_display_name!%ansi_reset% rem Check if outputs match if not "!region_name!"=="" if not "!region_display_name!"=="" ( if "!region_name!" equ "!region_display_name!" ( echo %ansi_green%MATCHING%ansi_reset% ) else ( rem Run command to extract Modify Date metadata and save output to a temporary file "%exiftool_path%" -T -FileModifyDate "%%F" > "%temp%\modify_date.tmp" rem Read contents of the temporary file to capture Modify Date metadata set /p modify_date=<"%temp%\modify_date.tmp" del "%temp%\modify_date.tmp" 2>nul rem Update metadata "%exiftool_path%" "-XMP-mwg-rs:RegionName>XMP-MP:RegionPersonDisplayName" -overwrite_original "%%F" echo %ansi_red%UPDATED%ansi_reset% rem Debug output echo Stored Modify Date: !modify_date! rem Write stored modified date back to the file "%exiftool_path%" -filemodifydate="!modify_date!" -overwrite_original "%%F" ) ) else ( echo %ansi_red%Missing metadata%ansi_reset% ))echo Script execution complete.pause
Statistics: Posted by MrKuenning — Fri Apr 12, 2024 11:20 pm