Last active
October 30, 2019 18:17
-
-
Save pcast01/2b662e1cd16228b3e1ce207c5f490f50 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
$magick = 'C:\Program Files\ImageMagick-7.0.3-Q16\magick.exe' | |
# Create the folder to store Next Gen images | |
$currentPath = Get-Location | |
New-Item -ItemType Directory -Force -Path "$($currentPath)\Images\JP2Files\" | |
New-Item -ItemType Directory -Force -Path "$($currentPath)\Images\WebPFiles\" | |
New-Item -ItemType Directory -Force -Path "$($currentPath)\Images\JXRFiles\" | |
New-Item -ItemType Directory -Force -Path "$($currentPath)\Images\JPXFiles\" | |
#jp2 | |
dir .\* -include ('*.png', '*.jpg') | select -ExpandProperty Name | ForEach-Object { & $magick convert ".\$($_)" "$($currentPath)\Images\JP2Files\$($_.ToString().Substring(0, $_.ToString().IndexOf('.'))).jp2" } | |
dir .\* -include ('*.png', '*.jpg') | select -ExpandProperty Name | ForEach-Object { & $magick convert ".\$($_)" "$($currentPath)\Images\WebPFiles\$($_.ToString().Substring(0, $_.ToString().IndexOf('.'))).webp" } | |
dir .\* -include ('*.png', '*.jpg') | select -ExpandProperty Name | ForEach-Object { & $magick convert ".\$($_)" "$($currentPath)\Images\JPXFiles\$($_.ToString().Substring(0, $_.ToString().IndexOf('.'))).jpx" } | |
dir .\* -include ('*.png', '*.jpg') | select -ExpandProperty Name | ForEach-Object { & $magick convert ".\$($_)" "$($currentPath)\Images\JXRFiles\$($_.ToString().Substring(0, $_.ToString().IndexOf('.'))).jxr" } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment