Forums / Developer / Image filter on TextToImage-generated images

Image filter on TextToImage-generated images

Author Message

Gunnar Birkeland

Tuesday 06 November 2007 6:53:06 am

Using this default texttoimage function:

{"26"|texttoimage('a_d_mono')}

Is there anyway I can access the generated image, and filter it with settings stored in image.ini?

I cant figure out how to fetch an instance of, lets say, 'small' version of the newly generated <i>26</i> - image.

Thanks in advance for all answers.

</major>
----------------------------
ez-version: 3.9.3.
PHP: 4.4.2-1
MYSQL: 4.0.24

Felix Laate

Tuesday 06 November 2007 2:06:40 pm

HI Gunnar,

did you have a look at <i>/PATH/TO/ezpublish/settings/texttoimage.ini</i>?

I seems that the image is stored once in a given size. If you need more versions you could make your own textToImage operator where you add code to store versions of the image.

Cheers

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

Gunnar Birkeland

Wednesday 07 November 2007 12:18:35 am

Hi:)

I was, as allways, hoping to avoid any customizing here. Seems this may be the only option available or not?

attribute(show) on the new object gives me the following.

filepath string 'var/cache/texttoimage/imagetext/7/c/f/7cf88a5bc61094113c35b80a3472b70a' 
filename string '26.png' 
width integer 195 
height integer 170 
alternative_text string 26 
imagepath string 'var/cache/texttoimage/imagetext/7/c/f/7cf88a5bc61094113c35b80a3472b70a/26.png'
has_size boolean true 

Does anyone know if its possible to put an imagemagick filter on this image with the information provided by its attributes?

</major>
----------------------------
ez-version: 3.9.3.
PHP: 4.4.2-1
MYSQL: 4.0.24

Gunnar Birkeland

Thursday 08 November 2007 12:43:35 am

[SOLVED]

In short i wanted to create google_maps pins in .png format dynamically. So on my way there i stumbled upon an example, http://issues.ez.no/IssueView.php?Id=1689&activeItem=7, in our issue tracker</a> which led me in the right direction.

Anyway, in case someone wonders, heres my code for it.

{def $my_gmap_png_filepath= image( 'my_new_image', imagefile( 'path_to_the_background_image' ),       		array( 'text_layer_on_my_new_image'|texttoimage( 'my_custom_texttoimage_font' ),
                hash( 'halign', 'center',
                'valign', 'middle',
                'y', 6,
                'x', 1 ) ) ).filepath}

Kaping!

</major>
----------------------------
ez-version: 3.9.3.
PHP: 4.4.2-1
MYSQL: 4.0.24