Skip to content

Instantly share code, notes, and snippets.

@Kianda
Created July 20, 2025 20:27
Show Gist options
  • Save Kianda/8352b4a3efe6012b3c68250acb7a29ff to your computer and use it in GitHub Desktop.
Save Kianda/8352b4a3efe6012b3c68250acb7a29ff to your computer and use it in GitHub Desktop.
Fix corrupted motion photos (remove the video)
Add-Type -AssemblyName System.Drawing
$inputFile = "C:\Users\myuser\Desktop\test\IMG_20220910_100157.jpg"
$outputFile = "C:\Users\myuser\Desktop\test\output.jpg"
try {
# Load the image - this automatically ignores motion data
$img = [System.Drawing.Image]::FromFile((Resolve-Path $inputFile))
# Save as new JPEG
$img.Save($outputFile, [System.Drawing.Imaging.ImageFormat]::Jpeg)
$img.Dispose()
Write-Host "Static photo saved successfully"
}
catch {
Write-Host "Error: $($_.Exception.Message)"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment