Batch processing folder with powershell in windows 10


#1

Hello Guys
I was able to process folder one year ago. Since the new version fo gmic, i am in touble : nothing happens with my script (even no error message)

What did I miss ?

Get-ChildItem “C:\Users\fransua\Desktop\FaceStyle” -Filter *.jpg |
Foreach-Object {
fileDestination="modifier1" + .Name
C:\Users\fransua.gimp-2.8\plug-ins\gmic_gimp_qt\gmic_gimp_qt.exe $
.FullName fx_crayongraffiti2_preview 300,50,1,0.4,12,1,2,1,0 -o $fileDestination


#2

Hi,

I would try something like this.

Get-ChildItem "C:\Users\fransua\Desktop\FaceStyle" -Filter *.jpg | Foreach-Object {
    $fileDestination = "modifier1" + $_.Name
    Start-Process "C:\Users\fransua.gimp-2.8\plug-ins\gmic_gimp_qt\gmic_gimp_qt.exe"`
    -WorkingDirectory "C:\Users\fransua.gimp-2.8\plug-ins\gmic_gimp_qt\"`
    -ArgumentList $_.FullName, "fx_crayongraffiti2_preview", "300,50,1,0.4,12,1,2,1,0", "-o", $fileDestination
}

Regards,

Yann


#3

Thanks Yann. Seems to work.

Now I have to resolved the next phase :

“libgimp-2.0-0.dll was not found”

:sunglasses:


#4

You’re welcome.

Have you tried with G’MIC Command-line interface (CLI) ?

I have some errors (dll files missing) with the plugin for Gimp but with the CLI it works fine.

Regards,

Yann


#5

Use fx_crayongraffiti2 instead. fx_crayongraffiti2_preview is for the plugin GUI.

If you would like to apply this command to all of your JPGs, in CLI do

gmic run "input_glob *.jpg fx_crayongraffiti2 300,50,1,0.4,12,1,2,1,0 repeat $! local[$>] output {b}.jpg endlocal done"

Edit: Sorry for the first 3 mins. I made lots of typos.

As you can see, you don’t need to use CMD or PowerShell loops for that.