[Typo3-dev] use IM combine funtion in an extension

Kraft Bernhard kraftb at gmx.net
Tue Feb 22 21:00:15 CET 2005


Wengrzik, Andreas wrote:
> file.height	435.6m
> file.width	440m
> file.params	-gravity SouthEast -font Tahoma -pointsize 11 -draw "fill black text 6,6 'myText' text 5,5 'myText' fill white text 4,4 'myText'"
> file.offset	0,0
> file.mask	/fileadmin/mask.png
> file	fileadmin/gallery_upload/myPicture.jpg
> alttext	myPicture.jpg

I was just taking a look at the TS Code I have and
was wondering over which image you would like to mask myPicture.jpg

I have the following code to take a picture and put another with the
offset 50,50 on it.
----------------snip-----------------
       $gifBuilder_Ar = array(
          'XY' => '300,150',
          'format' => 'jpg',
          'quality' => '90',
          'params' => '-quality 90',
          '1' => 'IMAGE',
          '1.' => array(
             'file' => 'fileadmin/img/bg.png',
          ),
          '2' => 'IMAGE',
          '2.' => array(
             'file' => 'fileadmin/img/layer.png',
             'offset' => '50,50',
          ),
       );
       $img_ar = $this->cObj->getImgResource('GIFBUILDER', $gifBuilder_Ar);
       $imgTSConfig = array();
       $imgTSConfig['file'] = $img_ar[3];
       $content .= $this->cObj->IMAGE($imgTSConfig);
----------------snip-----------------

If you want to generate some effects you could do something like:

3 = SCALE
3 {
   params = -gravity SouthEast -font Tahoma -pointsize 11 -draw "fill black text 6,6 'myText' text 5,5 'myText' fill white text 4,4 'myText'"
}

but be sure to escape the string properly when you transfer it to php ...

and you will of course need to use correct numbers 1. 2. 3.
in the order in which you apply the modifications
(1. should be the background image
2. should be the -params or a mask
3. should be mask or -params)


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




More information about the TYPO3-dev mailing list