[Typo3-dev] Longer runtime from script

Kraft Bernhard kraftb at gmx.net
Sun Feb 13 20:15:59 CET 2005


Hallo list,

I'm working on replacing ImageMagick through Gimp.

I experienced some problems with longer runtimes when the gimp is executed
via the apache.

if I do :
time /usr/bin/gimp-2.0 --verbose -i -g /var/www/localhost/htdocs/kraftb/testing/typo3conf/ext/kb_gimpgfx/res/gimprc -b "(gimp-typo3-resize 
\"/var/www/localhost/htdocs/kraftb/testing/typo3/sysext/install/imgs/jesus2_transp.gif\" 0 \"/var/www/localhost/htdocs/kraftb/testing/typo3temp/temp/535cf1d2f24f81805b1c9475f1eac219.xcf\" 150 120)" 
"(gimp-quit 0)"

from the commandline I get:
------------------snip----------------------
INIT: gimp_initialize
INIT: gimp_real_initialize
INIT: gimp_restore
INIT: gimp_real_restore
Starting extension: 'extension_script_fu'
batch command: executed successfully.
EXIT: gimp_exit
EXIT: gimp_real_exit
EXIT: batch_exit_after_callback

real    0m2.763s
user    0m2.001s
sys     0m0.465s
------------------snip----------------------

so it takes 2.763 seconds to perform a geometry change with the gimp
(any image magick references ?)

but if I do the following from within a php script:
------------------------snip-----------------------
       $gimp_cmd = $this->gimpPath.((substr($this->gimpPath,-1, 1)==='/')?'':'/').$this->gimpExecutable.' --verbose -i -g '.$this->abs_gimprc.' -b "'.$gimp_str.'" "(gimp-quit 0)"';
       echo "gimp_cmd: '".$gimp_cmd."'<br>\n";
       $start = microtime();
       $start = $this->getMicrotime($start);
       $res = exec($gimp_cmd, $out);
       $stop = microtime();
       $stop = $this->getMicrotime($stop);
       $diff = $stop-$start;
       echo "Diff: $diff<br>\n";
       print_r($out);
------------------------snip-----------------------

i get the followin result in the BE module (php script):
---------------------------snip---------------------
gimp_cmd: '/usr/bin/gimp-2.0 --verbose -i -g /var/www/localhost/htdocs/kraftb/testing/typo3conf/ext/kb_gimpgfx/res/gimprc -b "(gimp-typo3-resize 
\"/var/www/localhost/htdocs/kraftb/testing/typo3/sysext/install/imgs/jesus2_transp.gif\" 0 \"/var/www/localhost/htdocs/kraftb/testing/typo3temp/temp/7d0e4bd02334d5678be2d96f3ae1d0ce.xcf\" 150 120)" 
"(gimp-quit 0)"'<br>
Diff: 15.5468091965<br>
Array
(
     [0] => INIT: gimp_load_config
     [1] => Parsing '/etc/gimp/2.0/gimprc'
     [2] => Parsing '/var/www/localhost/htdocs/kraftb/testing/typo3conf/ext/kb_gimpgfx/res/gimprc'
     [3] => INIT: gimp_initialize
     [4] => INIT: gimp_real_initialize
     [5] => INIT: gimp_restore
     [6] => INIT: gimp_real_restore
     [7] => Starting extension: 'extension_script_fu'
     [8] => batch command: executed successfully.
     [9] => EXIT: gimp_exit
     [10] => EXIT: gimp_real_exit
     [11] => EXIT: batch_exit_after_callback
)
---------------------------snip---------------------

note the "Diff" value which states that it took 15 seconds to execute ....

why the difference .... i executed the command from the shell as webserver user via "su - apache"


greets,
Bernhard
-- 
----------------------------------------------------------------------
"Freiheit ist immer auch die Freiheit des Andersdenkenden"
Rosa Luxemburg, 1871 - 1919
----------------------------------------------------------------------




More information about the TYPO3-dev mailing list