Skip to content

Instantly share code, notes, and snippets.

@dylanlangston
Created April 23, 2020 13:10
Show Gist options
  • Save dylanlangston/6e517d6e9db01bed84d43992bbfc3c83 to your computer and use it in GitHub Desktop.
Save dylanlangston/6e517d6e9db01bed84d43992bbfc3c83 to your computer and use it in GitHub Desktop.
Powershell script to check if tifs in folder are multipage
$Folder = Read-Host -Prompt 'Input folder to check for Tifs: '
[System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") | Out-Null
Get-ChildItem $Folder -Filter *.tif |
Foreach-Object {
$a = [System.Drawing.Bitmap]::FromFile( $_.FullName )
if ($a.GetFrameCount( [System.Drawing.Imaging.FrameDimension]::Page ) -gt 1 )
{ "`"" + $_.FullName + "`" Tiff is multi pages" }
else
{ "`"" + $_.FullName + "`" Tiff is single page" }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment