Hallo zusammen, ich möchte ein Bild automatisch mit PowerShell skalieren. Allerdings bekomm ich beim Ausführen der PowerShell einen Fehler und kann mir nicht erklären woher er kommt.
Bibliothek: ImageMagick – Convert, Edit, or Compose Digital Images
Skript:Bild Skalieren | German PowerSHELL
Fehlermeldung:
# Bibliothek importieren
Add-Type -Path "C:\Bibliothek\Libl"
$EingangOrdner = "C:\Script\ImageMagick\Input\BildSkalieren"
$AusgangOrdner = "C:\Script\ImageMagick\Output\BildSkalieren"
# Geometrie Objekt erstellen für die genaue Grösse
$Geometrie = [ImageMagick.MagickGeometry]::new(500,0) # Breite, Höhe
$Geometrie.IgnoreAspectRatio = $false # Seitenverhältnis beibehalten
# Alle Bilder aus EingangOrdner auslesen
$AlleBilder = Get-ChildItem $EingangOrdner -File
for($i = 0; $i -lt $AlleBilder.Count; $i ++)
{
$Bild = [ImageMagick.MagickImage]::new($AlleBilder[$i].FullName)
# Bild der festgelegten Geometrie anpassen
$Bild.Resize($Geometrie)
$Bild.Write("$AusgangOrdner\$($AlleBilder[$i].Name)")
}