On 20 December 2013 15:18, ioannis latousakis <[email protected]> wrote: > I found a way to make this work with apache exec by doing the following: > > String [] cmd ={"-c","convert -size 140x80 xc:none -fill grey > -gravity NorthWest -draw \"text 10,10 'Copyright'\" -gravity SouthEast -draw > \"text 5,15 'Copyright'\" miff:- | composite -tile - > /Users/latu/Pictures/desert.jpg /Users/latu/Pictures/desertCP.jpg"}; > CommandLine convert_cmd = new CommandLine("/bin/sh");
Obviously, that only works if the OS has got a shell that supports this. You are now running everything through the shell, instead of running the commands directly. This is not generally recommended as it is relatively fragile and more prone to security issues. The recommended approach is to run each part of the pipe separately, and tie the output of the first command to the input of the second. > convert_cmd.addArguments( cmd,false ); > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
