RSS/Atom feed Twitter
Site is read-only, email is disabled

command line syntax for windows

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

4 of 4 messages available
Toggle history

Please log in to manage your subscriptions.

command line syntax for windows JamesMaeding 01 Nov 17:49
  command line syntax for windows JamesMaeding 01 Nov 17:56
   command line syntax for windows JamesMaeding 01 Nov 18:33
  command line syntax for windows JamesMaeding 01 Nov 20:07
2010-11-01 17:49:19 UTC (about 14 years ago)
postings
4

command line syntax for windows

Hello All,
I spent a bunch of time trying to figure out the correct syntax for running a scm that converted a file to .jpg. The GIMP help was fine for the scm code, but not so good for the command prompt of windows.

Here is what I found to work for a script named save-as-jpg.scm: (i am on win 7 64 bit, hence the (x86) in the path...

"C:\Program Files (x86)\GIMP-2.0\bin\gimp-2.6.exe" -i -b "(save-as-jpg "\"DSC_2636-Color24Bit.png\"" 0.7 "\"DSC_2636-Color24Bit.jpg\"")" -b "(gimp-quit 0)"

that worked. The changes from what the help file says to use are: 1) use full path of exe, in quotes.
2) use double quotes around GIMP functions, not single quotes 3) add double quote escape sequences around parameters that are strings

I looked far and wide to figure this out, so would guess others would be interested in the summary of what i found. Only remaining issue so far is how to get the secondary dos window that pops up, to close when its done. I thought the "(gimp-quit 0)" did that, but guess not.

2010-11-01 17:56:41 UTC (about 14 years ago)
postings
4

command line syntax for windows

Ok, seemed I needed to use the console exe. Now code is: "C:\Program Files (x86)\GIMP-2.0\bin\gimp-console-2.6.exe" -i -b "(save-as-jpg "\"DSC_2636-Color24Bit.png\"" 0.7 "\"DSC_2636-Color24Bit.jpg\"")" -b "(gimp-quit 0)"

Now to see if i can speed up the loading of GIMP for this as it took a few seconds longer to run than expected.

Hello All,
I spent a bunch of time trying to figure out the correct syntax for running a scm that converted a file to .jpg. The GIMP help was fine for the scm code, but not so good for the command prompt of windows.

Here is what I found to work for a script named save-as-jpg.scm: (i am on win 7 64 bit, hence the (x86) in the path...

"C:\Program Files (x86)\GIMP-2.0\bin\gimp-2.6.exe" -i -b "(save-as-jpg "\"DSC_2636-Color24Bit.png\"" 0.7 "\"DSC_2636-Color24Bit.jpg\"")" -b "(gimp-quit 0)"

that worked. The changes from what the help file says to use are: 1) use full path of exe, in quotes.
2) use double quotes around GIMP functions, not single quotes 3) add double quote escape sequences around parameters that are strings

I looked far and wide to figure this out, so would guess others would be interested in the summary of what i found. Only remaining issue so far is how to get the secondary dos window that pops up, to close when its done. I thought the "(gimp-quit 0)" did that, but guess not.

2010-11-01 18:33:35 UTC (about 14 years ago)
postings
4

command line syntax for windows

Another revision, i think this is optimized now for speed and (non)visibility of dos window:

start "convert" /min "C:\Program Files (x86)\GIMP-2.0\bin\gimp-console-2.6.exe" -i -d -f -b "(save-as-jpg "\"usgs.png\"" 0.7 "\"usgs.jpg\"")" -b "(gimp-quit 0)"

So I am using the dos Start command now, for its nice /min option. I use that, as well as /wait option for as close to silent installs as possible, so worked well here. I'm still wondering if the 10 seconds it takes to run can be improved. Its converting a 53mb png to jpg.

Ok, seemed I needed to use the console exe. Now code is: "C:\Program Files (x86)\GIMP-2.0\bin\gimp-console-2.6.exe" -i -b "(save-as-jpg "\"DSC_2636-Color24Bit.png\"" 0.7 "\"DSC_2636-Color24Bit.jpg\"")" -b "(gimp-quit 0)"

Now to see if i can speed up the loading of GIMP for this as it took a few seconds longer to run than expected.

2010-11-01 20:07:31 UTC (about 14 years ago)
postings
4

command line syntax for windows

ok, one last post, as i am getting tired of replying to myself, although not getting tired of solving things i have needed for a long time :) I realized I did not have full paths on the file, which is another syntax figuring out task. This works:

start "convert" /min "C:\Program Files (x86)\GIMP-2.0\bin\gimp-console-2.6.exe" -i -d -f -b "(save-as-jpg \"C:\\Users\\james\\Desktop\\gimptest\\USGS.png\" 0.7 \"C:\\Users\\james\\Desktop\\gimptest\\USGS.jpg\")" -b "(gimp-quit 0)"

so be sure to use double backslashes on those paths.