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,
i specify too many pixels i.e. imagecreate(600, 2290) it will not create the image,
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
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
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
this seems very strange, and I was wondering if anyone else has encountered this
i'm not sure if i've made myself too clear here, if you have any questions, fire away.
sorry for the long post
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php