Re: [OT] call gifsicle via Java process
Re: [OT] call gifsicle via Java process
- Subject: Re: [OT] call gifsicle via Java process
- From: Alexander Spohr <email@hidden>
- Date: Thu, 15 Feb 2007 11:03:58 +0100
sorry for the followup, my code was for another tool.
the right way is to put every single piece in its own array-element:
String args[] = new String[BASE_ARG_COUNT + moreArgsCount];
args[0] = imageResizerPath;
args[1] = "-resize";
args[2] = (aWidth != 0 ? String.valueOf(aWidth) : "") + (aHeight !=
0 ? "x" + String.valueOf(aHeight) : "") + (aWidth != 0 && aHeight !=
0 ? "!" : "");
args[3] = "-quality";
args[4] = "50";
args[5] = "-";
args[6] = "-";
Am 15.02.2007 um 10:31 schrieb Alexander Spohr:
Am 10.02.2007 um 11:56 schrieb Ute Hoffmann:
P.S:
This is my call:
String[] cmdArray = new String[] {
"/usr/local/bin/gifsicle "+"< "+sourceFilePath+" > "+outFilePath
};
this seems wrong.
i don't think, that you can just repipe stdin and stdout like this.
that's a function of the shell. and you have no shell by calling exec.
NSMutableArray stdErrContents = new NSMutableArray();
NSMutableArray stdOutContents = new NSMutableArray();
int resultCode;
try {
resultCode = exec( cmdArray, stdOutContents, stdErrContents );
}
catch ....
here is your stdout.
try using
gifsicle infile.gif -o outfile.gif
(see http://www.lcdf.org/gifsicle/man.html)
and you have to build the cmdArray in the right way. adding
parameters to the first element (the executable) will not work.
Freeport & Soliversum
Alexander Spohr
email@hidden
www.freeport.de
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden