No change.
At php.net it shows a table about image formats. And it shows a couple libraries to download for each format. Do i need those downloaded too? And the Font libraries?
No change.
At php.net it shows a table about image formats. And it shows a couple libraries to download for each format. Do i need those downloaded too? And the Font libraries?
Oh, i think i'm onto something here, before i put the error_all thing that you suggested, and before i took out the header, the image was just the box with an X in it. So i was reading at php.net, and it says that to put the image in png format you need to donwload another library. well in my script the image is output as a png. So i tried instead of using imagepng($im) i used imagejpeg($im), but still just a box with an X.![]()
The box with the X just means that your script isn't actually outputting a perfectly-formed image. Can you post the script?
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
Allright, well this code i took from www.php.net to test my computer and see if i had the GD thing properly installed and whatnot, so i don't really understand it, and that may be why my image wont show.
Code:<?php header("Content-type: image/png"); $im = @imagecreate(100, 50) or die("Cannot Initialize new GD image stream"); $background_color = imagecolorallocate($im, 255, 255, 255); $text_color = imagecolorallocate($im, 233, 14, 91); imagestring($im, 1, 5, 5, "A Simple Text String", $text_color); imagejpeg($im); imagedestroy($im); ?>
Well, that looks fine to me. Find out where your php_gd2.dll file resides, and check that your php.ini points to it correctly.
/EDIT: Actually, try this first:Code:<?php if(function_exists('imagecreate')) die('GD is working.'); else die('GD isn't working.'); ?>
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
The page is now blank again.
The directory is pointed in the right place for where php_gd2.dll is located.
I tried changing the code to see if my page would change to be the box with the X instead of blank. Here's my code now:
Again, that was taken from www.php.net since i dont know how to script it quite yet.Code:<?php $im = imagecreate(100, 100); $string = 'PHP'; $bg = imagecolorallocate($im, 255, 255, 255); $black = imagecolorallocate($im, 0, 0, 0); // prints a black "P" in the top left corner imagechar($im, 1, 0, 0, $string, $black); header('Content-type: image/png'); imagepng($im); ?> <?php if(function_exists('imagecreate')) { die('GD is working.');} else { die('GD isn't working.');} ?>
No no, not after the rest of the code, I intended you to put that code in a separate page.
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
Oh.
Hahah, I didn't catch this before: the code you told me to put in was missing something, no wonder it didnt work.
The second die() function - 'isn\'t'. Hehe, no wonder it wasn't working.Code:<?php if(function_exists('imagecreate')) { die('GD is working.');} else { die('GD isn't working.');} ?>
Anyway, i put that code in a separate page, and it turns out GD isn't working.
Whoops, yeah, sorry.
Where is php_gd2.dll? What are the pertinent lines of php.ini?
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
I dont know what pertinant means, but i'm assuming you want to see the lines in my php.ini that show you exactly where GD is located:
then later in php.iniCode:extension_dir = "c:\web\php\extensions"
and thats it.Code:extension=php_gd2.dll
Bookmarks