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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 19:21:19
Script start
Timing: Jan 18 2025 19:21:19
Module start 'layout'
Timing: Jan 18 2025 19:21:19
Module start 'content'
Timing: Jan 18 2025 19:21:21
Module end 'content'
Timing: Jan 18 2025 19:21:21
Script end

Main resources:

Total runtime1.5456 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0076 589.1797152.6406
Module start 'layout' 0.00760.0036 741.820339.4766
Module start 'content' 0.01121.5330 781.2969553.6094
Module end 'content' 1.54410.0014 1,334.906312.1250
Script end 1.5456  1,347.0313 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.2318160.0002
Check MTime0.00150.0938160.0001
Mysql Total
Database connection0.00080.050910.0008
Mysqli_queries1.484396.0352600.0247
Looping result0.00070.0464580.0000
Template Total1.509997.720.7550
Template load0.00230.147320.0011
Template processing1.507697.543420.7538
Template load and register function0.00010.007010.0001
states
state_id_array0.00080.053810.0008
state_identifier_array0.00120.080220.0006
Override
Cache load0.00190.1253300.0001
Sytem overhead
Fetch class attribute can translate value0.00120.078620.0006
Fetch class attribute name0.00320.209760.0005
XML
Image XML parsing0.00110.071920.0006
class_abstraction
Instantiating content class attribute0.00000.000980.0000
General
dbfile0.00100.0656220.0000
String conversion0.00000.000740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 18
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs