[TYPO3-dev] RFC: adding debug info to stdGraphic IM_command array
Martin Kutschker
martin.kutschker-n0spam at no5pam-blackbox.net
Tue Jul 10 18:47:06 CEST 2007
Wolfgang Klinger schrieb:
> *hiya!*
>
> On Jul 9, 2007, at 2:36 PM, Martin Kutschker wrote:
>> Any problems adding the following function like that?
>>
>> function imageMagickExec($input,$output,$params) {
>> if (!$this->NO_IMAGE_MAGICK) {
>> $cmd = t3lib_div::imageMagickCommand('convert', $params.
>> ' '.$this->wrapFileName($input).' '.$this->wrapFileName($output));
>>
>> // CHANGE IS HERE: added processeing of status and full program
>> output
>> $ret = exec($cmd.' 2>&1',$message,$status);
>> $this->IM_commands[] = array($output,$cmd,$status,$message);
>>
>> t3lib_div::fixPermissions($this->wrapFileName($output));
>>
>> return $ret;
>> }
>> }
>
> Should work and make no problems... at least on Unix,
> I don't know what happens on Windows when executing the command
> with the output channel redirects (2>&1)?
I tried to use that syntax on the Windows CL and it didn't choke.
> btw $ret is never used by any calling method,
> maybe we can remove that here?
Probably. Or better return the status or ($status:FALSE:TRUE).
Masi
More information about the TYPO3-dev
mailing list