Anyone successfully overlay text on an image?

Author Message

Mark Marsiglio

Tuesday 28 September 2004 12:45:35 pm

I have tried to take text from a text line in my class and overlay it over an image from the same class with quite unreliable and varied results.

The goal is to have white text over the image background. So far I have been able to achieve:
-a solid white box approximately the size of the text
-text that is a dark semi-transparent color
-text knocked out of a white background with some transparency (but not able to control it)
-a background image whose colors are completely distorted (looks like it was converted to a 4 color image)

I have tried the following as source images:
-PNG-8
-PNG-24
-JPG
-GIF

JPG is the worst offender, as the colors are always way off. I was hoping to allow my content managers to upload any file within reason and have it automatically add the text, resize it, and place it on the page for them.

I have tried this code:

{image("hometest16",imagefile('var/cache/texttoimage/testing.png'),
array(" Activities"|texttoimage(top),
hash(transparency,0,halign,left,valign,top)))}

Where the source image is testing.png, the text we want to add is "Activities" and the texttoimage(top) style is set to white text, no background color. This results in the white box (white text on a white background added on top of the image).

From the docs this seems possible, but if someone can help with a code sample that works it would be great (or any troubleshooting ideas).

http://www.thinkcreative.com
Turning Ideas Into Strategic Solutions

Björn Dieding@xrow.de

Tuesday 28 September 2004 3:30:01 pm

please try the 3.5 kernel...

I did some improvements on the image resource handling there.

Please also confirm that setup GD/GD2.

Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs
Looking for hosting? http://hostingezpublish.com
-----------------------------------------------------------------------------
GMT +01:00 Hannover, Germany
Web: http://www.xrow.com/

Mark Marsiglio

Tuesday 28 September 2004 5:14:26 pm

I just installed 3.5 from the CVS last night. I will give it a shot - thanks.

http://www.thinkcreative.com
Turning Ideas Into Strategic Solutions

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 20 2025 00:58:38
Script start
Timing: Jan 20 2025 00:58:38
Module start 'layout'
Timing: Jan 20 2025 00:58:38
Module start 'content'
Timing: Jan 20 2025 00:58:39
Module end 'content'
Timing: Jan 20 2025 00:58:39
Script end

Main resources:

Total runtime0.9066 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0073 589.2891152.6406
Module start 'layout' 0.00730.0036 741.929739.4766
Module start 'content' 0.01090.8940 781.4063549.4219
Module end 'content' 0.90490.0016 1,330.828112.4375
Script end 0.9065  1,343.2656 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.4042160.0002
Check MTime0.00140.1546160.0001
Mysql Total
Database connection0.00100.106110.0010
Mysqli_queries0.847593.4815570.0149
Looping result0.00130.1424550.0000
Template Total0.871496.120.4357
Template load0.00260.285120.0013
Template processing0.868895.832820.4344
Template load and register function0.00010.013310.0001
states
state_id_array0.00130.144710.0013
state_identifier_array0.00080.089820.0004
Override
Cache load0.00220.2402280.0001
Sytem overhead
Fetch class attribute can translate value0.00080.091920.0004
Fetch class attribute name0.00210.232550.0004
XML
Image XML parsing0.00120.132720.0006
class_abstraction
Instantiating content class attribute0.00000.001760.0000
General
dbfile0.00100.1059210.0000
String conversion0.00000.004240.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
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/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/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/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: 17
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs