Created
November 27, 2025 19:33
-
-
Save Rajdave69/23520a64e5aff997a3b1797a8c6b1c12 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This script copies the metadata of a specified image to all other imges (.TIF, JPG) within the current directory | |
| # Define the input file (use absolute path) | |
| $InputFile = "" | |
| # Ensure exiftool exists | |
| if (-not (Get-Command exiftool -ErrorAction SilentlyContinue)) { | |
| Write-Error "ExifTool not found. Please install it first." | |
| exit | |
| } | |
| # Get all .tif and .jpg files recursively | |
| Get-ChildItem -Recurse -Include *.tif, *.jpg | ForEach-Object { | |
| $TargetFile = $_.FullName | |
| Write-Host "Copying EXIF from $InputFile to $TargetFile ..." | |
| exiftool -overwrite_original ` | |
| -TagsFromFile "$InputFile" ` | |
| -all:all -unsafe ` | |
| -copyright= -ThumbnailImage= -PreviewImage= ` | |
| "-tagsFromFile" "@" -icc_profile -Software ` | |
| "$TargetFile" | |
| } | |
| Write-Host "Metadata copy complete." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment