0

I'm generating an image out of text using php. My code works perfectly on my localhost and the text is generated fine. However on my online host it doesn't generate the whole text just bits and pieces of it. Like if I were to pass the text 'This is some text' to it - it would generate just maybe an S or t.

The code is fine as it works perfectly on my localhost but doesn't run on the online host. It cant be that gd isnt on the host else it would not even generate part of the image.

WHats going on here :(


UPDATE

This is the GD CONfig on teh server - I don't think there is anything wrong with it

gd
GD Support  enabled
GD Version  bundled (2.0.34 compatible)
FreeType Support    enabled
FreeType Linkage    with freetype
FreeType Version    2.2.1
GIF Read Support    enabled
GIF Create Support  enabled
JPG Support     enabled
PNG Support     enabled
WBMP Support    enabled
XBM Support     enabled 

I'm just turning email addresses and fone numbers into one image. Heres an image of what the text should look like:

localhost image

But this is what its rendering on the online:

online image mess


UPDATE

I just found out something weird. If I try to create an image out of the text 'P P' it should create the following image which it does on my localhost. what I want

But on the online server its creating the image as so - the space is humongous and distorted. Could this be a hint as to why is it not rendering the text as it should.

bad pic

Please guys I need help here urgently :(.

3
  • 1
    What operating system on the server? Commented Jul 9, 2009 at 5:40
  • 1
    Can you provide example images? One correct and one broken? Commented Jul 9, 2009 at 5:41
  • I added the pictures! Please tell me whats wrong here! Commented Jul 13, 2009 at 13:26

3 Answers 3

1

Compare your local phpinfo() to the live phpinfo() and look for differences.

Turn on full error reporting in the image generation script:

 ini_set("display_errors","2");

 error_reporting(E_ALL);

Then run it directly by pointing your browser at the URL that renders the image.

Sign up to request clarification or add additional context in comments.

1 Comment

DOne that but can't seem to find any errors being reported :( - check my post for update!
1

see if the GD library is install in server Correctly

Comments

1
  • Is the proper font installed on the host?
  • Is the content-encoding of the image set properly?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.