473,395 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

imagettftext problem

My url is www.aptitudehack.com

Hi i cant get an image to display on another server though it does on
mine. Here is the code for the page. The problem i think is the
imagettftext function particularly the reference to my font file
"Verdana". If i use a different function to write text it does so no
bother but unfortunately i need this function to work. Here is the
error it outputs followed by the code for the page in question:
The image "http://www.aptitudehack.com/imagepage.php" cannot be
displayed, because it contains errors.
<?php

// Define .PNG image
header("Content-type: image/png");
$imgWidth=575;
$imgHeight=175;

// Create image and define colors
$image=imagecreate($imgWidth, $imgHeight);
$colorWhite=imagecolorallocate($image, 255, 255, 255);
$colorRed=imagecolorallocate($image, 255, 0, 0);

//label y axis
imagettftext($image, 7, 0, 22, 110, $colorRed, 'Verdana', 'results');
//this should output the word results

// Output graph and clear image from memory
imagepng($image);
imagedestroy($image);
?>

//the font file is definitely in the same directory

May 16 '06 #1
6 2511
Carved in mystic runes upon the very living rock, the last words of
monomaniac21 of comp.lang.php make plain:
My url is www.aptitudehack.com

Hi i cant get an image to display on another server though it does on
mine. Here is the code for the page. The problem i think is the
imagettftext function particularly the reference to my font file
"Verdana". If i use a different function to write text it does so no
bother but unfortunately i need this function to work. Here is the
error it outputs followed by the code for the page in question:

The image "http://www.aptitudehack.com/imagepage.php" cannot be
displayed, because it contains errors.


I get a 404 at that URL. That would definitly not be a valid PNG image.

--
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/
May 16 '06 #2
sorry wrong url

May 17 '06 #3
Carved in mystic runes upon the very living rock, the last words of
monomaniac21 of comp.lang.php make plain:
sorry wrong url


Well, it's kind of hard to figure out what the problem is, then.

--
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/
May 17 '06 #4
alan could i mail you the page and you could see if it works on your
server?

May 17 '06 #5
Carved in mystic runes upon the very living rock, the last words of
monomaniac21 of comp.lang.php make plain:
alan could i mail you the page and you could see if it works on your
server?


Have you tried loading the script, on the non-working server, directly?
That is, type the URL in your address bar, rather than putting it in an IMG
tag. See what it outputs.

--
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/
May 17 '06 #6
yeah it outputs what i wrote earlier. No worries though im just gonna
have to rewrite the script using the slightly uglier imagestring
function instead. thanks for the help though alan i appreciate it.

May 19 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: bof | last post by:
I'm attempting to use ImageTTFText to render text to an image, I can get it to work if I a) specify the full font path b) switch off anti-aliasing c) specify an OpenType font (e.g. arial.ttf) ...
0
by: John Wellesz | last post by:
Hi, since I've upgraded to php 4.3.4 (before I used 4.1.2) I have a problem with imagettftext(): when executing the line: imagettftext($im, 20, 0, 10, 25, $white, "$script_dir/verdana.ttf",...
3
by: Leif Wessman | last post by:
From: http://www.php.net/manual/en/function.imagettftext.php "color is the color index. Using the negative of a color index has the effect of turning off antialiasing." I'm using a bundled...
1
by: Axier | last post by:
I cannot get the swedish character set on images. What can be wrong? I would very much appreciate help. regards, axier I can supply some code here and a link:...
0
by: ljb | last post by:
Using PHP-4.3.11 with GD extension, bundled GD library, and freetype-2.1.9 (with X.org 6.8.1). I can't get the TrueType Font (TTF) bounding box to come out right. Whether using imagettftext() or...
2
by: Gordan | last post by:
Im using imagettftext to write some text on my image. I'm on Win XP and using the plain arial.ttf font that I copied from win dir my typical line would be imagettftext($im, 33, 0, 20, 500, $black,...
1
by: franscescomoi | last post by:
Hi. On PHP 4.3.10 on Linux I try to: ------ $im = imagecreate(400, 30); $black = imagecolorallocate($im, 0, 0, 0); imagettftext($image, 20, -3, 10, 20, $black, 'Arial.ttf', 'Test'); ------- ...
0
by: Nemo | last post by:
Hi. I'm having a problem with a php program on debian. As you all probably guessed from the title, I get an undefined function call error whenever I call imagettftext (). I did compile php with...
3
by: Doraj | last post by:
Hello ! Here is my problem : I had some php scripts which worked well with php 4.0.5 (GD 1.6.2 according to phpinfo() ) and i put them on a new server with php 4.4.2 (and GD 2.0.28). Now,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.