My $0.02--might have absolutely nothing to do with the problems you are
having!
I had strange problems with my image code which were due to the font I used.
My code would run sometimes and sometimes die in the gate.  Seems that you
need a "unicode" font, and not all true type fonts are such.
Hoping you'll get your problems resolved.
Hugh
----- Original Message -----
From: "Conor McTernan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 26, 2002 11:34 AM
Subject: [PHP] another GD question


> two in two days, i must look like a real retard.
>
> anyway, i'm having another problem with GD now, it seems that when i
create my image, if
> i specify too many pixels i.e. imagecreate(600, 2290) it will not create
the image, just
> a blank file
>
> it's sort of hard to explain, but i'll try.
>
> i am currently reading in a html file, which i want to display as an
image. I read in my
> HTML and strip it of all HTML tags, this is stored as a varaible. i now
explode this
> string using every occurence of a new line (\n), into an array, this gives
me an array
> of lines. I now want to format the text a little bit, because I dont want
my lines to be
> too long, so i word wrap it to 40 cols, followed by a rtrim, just to
remove any chars
> that will appear in the image that i dont want.
>
> i then pass this array into my imageMake method. i create my image, using
imagecreate,
> now, for my x value, i set it to be 500, and i set my y value to be
1963(i'll explain
> why in a minute). i then execute a for loop, which runs through each of
the elements of
> the array(each line of text) and runs the GD ImageString function, this
will take an
> incrementing value, making sure that each new line is below each other.
>
> when the for loop is completed, i call ImagePNG and then ImageDestroy. I
suppose I
> should mention that I am creating a seperate image, and not displaying it
imediattly.
>
> anyway, so long as I keep the Y value of the imagecreate function below
1963 the image
> will be created, but not all of the text is dispayed, since there seems to
be more
> lines of text than area displayed.. if it is larger than that, all i get
is a blank
> image, and if i try opening it in an image viewer i get an error.
>
> i have a feeling that it is someway related to the size of my text set,
i.e. it is
> currently 216 lines long(after i perform the word wrap on it). also, if I
run the exact
> same code on the same text formatted differntly (HTML removed, wordwrapped
all done in
> pre-processing) it seems that I am able to increase the Y value in the
imagecreate
> function, but, I still cannot raise it so far as to be able to include all
of the text.
>
> this seems very strange, and I was wondering if anyone else has
encountered this problem
> before.
>
> i'm not sure if i've made myself too clear here, if you have any
questions, fire away.
>
> sorry for the long post
>
> Conor
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to