フォルダ内の画像のサイズを小さくするスクリプトを作成しようとしています。しかし、私はいつもエラーメッセージがあります。 同じフォルダとサブフォルダのサイズを小さくする必要がありますPowerShell - 画像のサイズを小さくする
スクリプトを作成するのに役立つことができますか?
ありがとうございます。
$source = "U:\TEST\Compression\images"
$exclude_list = "(Imprimerie|Photos)"
$source_listephotos = Get-ChildItem $source -Recurse | where {$_.FullName -notmatch $exclude_list}
foreach ($source_photos in $source_listephotos) {
$source_photos
Resize-Image -InputFile $source_photos.FullName -Scale 30 -OutputFile (Join-Path $source $source_photos.Name) -Verbose
}
そして、ここでエラーメッセージ:
Exception calling "Save" with "1" argument(s): "A generic error occurred in GDI+."
At C:\windows\system32\windowspowershell\v1.0\Modules\Resize-Image\Resize-Image.psm1:70 char:9
+ $img2.Save($OutputFile);
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ExternalException
ありがとうございました。 イメージ.pngのサイズを小さくすることはできますか?スクリプトの変更により画像拡張子が変更されました。 – pcarrey
申し訳ありません、それは私です、私は$ sourceで間違いを犯しました。 – pcarrey
私は他の問題があります。私は写真付きのフォルダをいくつか除外しなければならないが、パラメータ-excludeは機能しない。私はどうすればいいですか? – pcarrey