Skip to content

Instantly share code, notes, and snippets.

@pleabargain
Created January 29, 2025 13:58
Show Gist options
  • Save pleabargain/c3018173d740421b0e906db8aa0c939e to your computer and use it in GitHub Desktop.
Save pleabargain/c3018173d740421b0e906db8aa0c939e to your computer and use it in GitHub Desktop.
powershell using magick to zoom in and crop a photo to 2:3 ratio
Get-ChildItem -Path . -File | Where-Object { $_.Name -notmatch '\s' } | ForEach-Object {
$output = Join-Path $_.DirectoryName ($_.BaseName + "_cropped" + $_.Extension)
magick $_.FullName -gravity center -resize 130% -crop 2:3 +repage $output
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment