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

eZ debug

Timing: Jan 18 2025 18:25:56
Script start
Timing: Jan 18 2025 18:25:56
Module start 'content'
Timing: Jan 18 2025 18:25:56
Module end 'content'
Timing: Jan 18 2025 18:25:56
Script end

Main resources:

Total runtime0.8118 sec
Peak memory usage4,096.0000 KB
Database Queries197

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0069 587.8438180.8125
Module start 'content' 0.00690.6532 768.6563558.7031
Module end 'content' 0.66010.1515 1,327.3594336.7422
Script end 0.8116  1,664.1016 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00440.5477210.0002
Check MTime0.00160.1956210.0001
Mysql Total
Database connection0.00090.109810.0009
Mysqli_queries0.722689.00971970.0037
Looping result0.00220.27631950.0000
Template Total0.784996.720.3924
Template load0.00200.241920.0010
Template processing0.782996.442120.3914
Template load and register function0.00010.012510.0001
states
state_id_array0.00140.169910.0014
state_identifier_array0.00070.084620.0003
Override
Cache load0.00170.2080300.0001
Sytem overhead
Fetch class attribute can translate value0.00240.291730.0008
Fetch class attribute name0.00200.250360.0003
XML
Image XML parsing0.00170.211730.0006
class_abstraction
Instantiating content class attribute0.00000.002380.0000
General
dbfile0.00230.2815330.0001
String conversion0.00000.000630.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 18
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs