Skip to content

Instantly share code, notes, and snippets.

@Rajdave69
Created November 27, 2025 19:33
Show Gist options
  • Select an option

  • Save Rajdave69/23520a64e5aff997a3b1797a8c6b1c12 to your computer and use it in GitHub Desktop.

Select an option

Save Rajdave69/23520a64e5aff997a3b1797a8c6b1c12 to your computer and use it in GitHub Desktop.
# 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