Re: [PHP] imagecreate inside an object
On Fri, 2010-08-20 at 00:44 +0200, Lorenzo Marussi wrote: > hello list, > > I'm trying to manage a image resouce inside a method, but > unsuccessfully... > > In detail, that's some code snippets: > > the class and the method: > > class.php > > class canvas{ > > function makeImage($imageWidth = 850){ > > $im = imagecreate(110, 20) or die("Cannot Initialize new GD > image stream"); > $background_color = imagecolorallocate($im, 0, 0, 0); > $text_color = imagecolorallocate($im, 233, 14, 91); > imagestring($im, 1, 5, 5, "A Simple Text String", $text_color); > return $im; > } > > } > > ... than my test.php file: > > header("Content-type: image/png"); > include_once("class.php"); > $c = new canvas(); > imagepng($c->makeImage()); > > the result in the browser isn't the image itself, but an error that > sounds like: (I traslate the message from italian): > "Image can't be displayed because contains some errors" > > but... if I comment out the "header" line, I get this: > > ‰PNG ��� IHDR���n������V,š���PLTE���é[an÷���fIDAT•c` `fxÄÀÃ`Ç > ÀçÀä²41ƒ‚€˜Ë–Ý’À...@੤;{á0— œi > > ...sounds like a png image, isn't it? but It doesn't :-/ > > The code in the method is very simple, is the same of the php manual > page of "imagecreate" function, and I think the resource is correctly > managed, 'cause if I write this: > > $c = new palinsestoCanvas(3); > imagepng(null); > > I get: "Warning: imagepng(): supplied argument is not a valid Image > resource" > > .. so I think $c->makeImage()) returns successfully the resource.. but I > still didnt see my image.. > > > Any help is appreciated, thanks > > Lorenzo > > > > It looks like you might be outputting some extra content to the browser, such as newlines or other content. Use the second parameter of imagepng() to write the image to a file and compare the size of that with the bytes sent to the browser (you should be able to get this from the browsers properties dialogue) >From the looks of what you've pasted, the extra content is appearing right after the image data, so perhaps an exit; call right after imagepng() and seeing if that solves the problem. Thanks, Ash http://www.ashleysheridan.co.uk
[PHP] imagecreate inside an object
hello list, I'm trying to manage a image resouce inside a method, but unsuccessfully... In detail, that's some code snippets: the class and the method: class.php class canvas{ function makeImage($imageWidth = 850){ $im = imagecreate(110, 20) or die("Cannot Initialize new GD image stream"); $background_color = imagecolorallocate($im, 0, 0, 0); $text_color = imagecolorallocate($im, 233, 14, 91); imagestring($im, 1, 5, 5, "A Simple Text String", $text_color); return $im; } } ... than my test.php file: header("Content-type: image/png"); include_once("class.php"); $c = new canvas(); imagepng($c->makeImage()); the result in the browser isn't the image itself, but an error that sounds like: (I traslate the message from italian): "Image can't be displayed because contains some errors" but... if I comment out the "header" line, I get this: ‰PNG ��� IHDR���n������V,š���PLTE���é[an÷���fIDAT•c` `fxÄÀÃ`Ç ÀçÀä²41ƒ‚€˜Ë–Ý’À...@੤;{á0— œi ...sounds like a png image, isn't it? but It doesn't :-/ The code in the method is very simple, is the same of the php manual page of "imagecreate" function, and I think the resource is correctly managed, 'cause if I write this: $c = new palinsestoCanvas(3); imagepng(null); I get: "Warning: imagepng(): supplied argument is not a valid Image resource" .. so I think $c->makeImage()) returns successfully the resource.. but I still didnt see my image.. Any help is appreciated, thanks Lorenzo
Re: [PHP] imagecreate() question
Did you try making it transparent first, before adding the circle? Only a question because I'm not sure if it will make a difference. I know I had problems trying to get the alpha blending to actually look decent in png's (ended up looking like a very poor gif with a non- antialiased mask) and I think I eventually gave up and put the image on a white background. But that was six months to a year ago and anything more than two weeks out is all but forgotten, old-timers disease I think. Ed On Apr 2, 2007, at 12:26 PM, tedd wrote: At 4:27 PM +0100 4/2/07, Richard Davey wrote: tedd wrote: In the php manual it says: imagecreate() returns an image identifier representing a blank image of specified size. We recommend the use of imagecreatetruecolor(). Q: Why the recommendation? Because the need to create 256 colour (or less) images grows less year by year. If you need to work with a jpeg/png then imagecreatetruecolor() is required. As this is what most people need, hence the manual comment exists. imagecreate() returns a "blank" page whereas imagecreatetruecolor () returns a "black" page. Sure, but both are easily changed. Cheers, Rich I found, which generated my questions, that the difference between a "blank" page and a "black" page can be significant when dealing with alpha channels. For example, if I create a "blank" page and then place a 50 percent transparent circle on it, it works. However if I do the same thing using a "black" page and change the color black to transparent, I lose the 50 percent transparency of the circle. In other words, it generates a transparent page with a nontransparent circle. If anyone knows how to use imagecreatetruecolor() to create a png image that has a 100% transparent background with a 50% transparent circle on it, I sure would like to see how you did it. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- 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
Re: [PHP] imagecreate() question
At 4:27 PM +0100 4/2/07, Richard Davey wrote: tedd wrote: In the php manual it says: imagecreate() returns an image identifier representing a blank image of specified size. We recommend the use of imagecreatetruecolor(). Q: Why the recommendation? Because the need to create 256 colour (or less) images grows less year by year. If you need to work with a jpeg/png then imagecreatetruecolor() is required. As this is what most people need, hence the manual comment exists. imagecreate() returns a "blank" page whereas imagecreatetruecolor() returns a "black" page. Sure, but both are easily changed. Cheers, Rich I found, which generated my questions, that the difference between a "blank" page and a "black" page can be significant when dealing with alpha channels. For example, if I create a "blank" page and then place a 50 percent transparent circle on it, it works. However if I do the same thing using a "black" page and change the color black to transparent, I lose the 50 percent transparency of the circle. In other words, it generates a transparent page with a nontransparent circle. If anyone knows how to use imagecreatetruecolor() to create a png image that has a 100% transparent background with a 50% transparent circle on it, I sure would like to see how you did it. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] imagecreate() question
tedd wrote: In the php manual it says: imagecreate() returns an image identifier representing a blank image of specified size. We recommend the use of imagecreatetruecolor(). Q: Why the recommendation? Because the need to create 256 colour (or less) images grows less year by year. If you need to work with a jpeg/png then imagecreatetruecolor() is required. As this is what most people need, hence the manual comment exists. imagecreate() returns a "blank" page whereas imagecreatetruecolor() returns a "black" page. Sure, but both are easily changed. Cheers, Rich -- Zend Certified Engineer http://www.corephp.co.uk "Never trust a computer you can't throw out of a window" -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] imagecreate() question
Hi gang: A couple of image questions: In the php manual it says: imagecreate() returns an image identifier representing a blank image of specified size. We recommend the use of imagecreatetruecolor(). Q: Why the recommendation? imagecreate() returns a "blank" page whereas imagecreatetruecolor() returns a "black" page. Q: Is there a problem with a "blank" page? Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] imagecreate
On 8 Feb 2006, at 14:20, Ross wrote: I am trying to replace the images in a page with this code This is fine here... http://www.ecurry.net/example1.php http://www.ecurry.net/example2.php but when I try and embed in inside a html page I get a garbled mess http://www.ecurry.net/menu6.php http://www.ecurry.net/menu6.phps I know this has something to so with the header but cannnot work it out! I tried header("Content-type: image/png"); before the output but I get a garbled mess and the header error. You need to output the png content type header before the call to imagepng(). If you get a garbled mess the chances are that your script is not 'clean'. In other words, you have output some data elsewhere in your script. This could be something as simple (and invisible) as a carriage-return after your closing PHP tag. Cheers, Rich -- http://www.corephp.co.uk Zend Certified Engineer PHP Development Services -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] imagecreate
Hi, I am trying to replace the images in a page with this code This is fine here... http://www.ecurry.net/example1.php http://www.ecurry.net/example2.php but when I try and embed in inside a html page I get a garbled mess http://www.ecurry.net/menu6.php http://www.ecurry.net/menu6.phps I know this has something to so with the header but cannnot work it out! I tried header("Content-type: image/png"); before the output but I get a garbled mess and the header error. R. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] imagecreate undefined...?
Have you tried dynamically loading the GD functions; http://us2.php.net/manual/en/function.dl.php if (!extension_loaded('php_gd')) { if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) { dl('php_gd.dll'); } else { dl('gd.so'); } } not sure all the names above are correct and you can eliminate a lot of stuff for Win/Linux installations if you are not targeting both versions. Warren Vail -Original Message- From: Richard Davey [mailto:[EMAIL PROTECTED] Sent: Friday, February 13, 2004 8:07 AM To: Eric Cc: [EMAIL PROTECTED] Subject: Re: [PHP] imagecreate undefined...? Hello Eric, Friday, February 13, 2004, 4:00:02 PM, you wrote: E> Fatal error: Call to undefined function: imagecreate() in [file name] on line 3 E> I am running under MacOSX 10.3.2 and PHP 4.3.2. Sounds very much like you have PHP without the image library compiled into it. I don't know where to obtain that lib for the Mac, sorry - but I'm sure someone will. -- Best regards, Richardmailto:[EMAIL PROTECTED] http://www.phpcommunity.org/wiki/296.html -- 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
Re: [PHP] imagecreate undefined...?
On Fri, 2004-02-13 at 11:00, Eric wrote: > However, when I run it, I get an error: > > Fatal error: Call to undefined function: imagecreate() in [file name] on line 3 Sound like your version was complied without GD support. http://www.php.net/manual/en/ref.image.php -- BrianGnuPG -> KeyID: 0x04A4F0DC | URL: www.gfx-design.com/keys Key Server: pgp.mit.edu == gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC GnuPG: http://gnupg.org http://www.biglumber.com/x/web?qs=0x2C35011004A4F0DC Linux Registered User #339825 at http://counter.li.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] imagecreate undefined...?
Hello Eric, Friday, February 13, 2004, 4:00:02 PM, you wrote: E> Fatal error: Call to undefined function: imagecreate() in [file name] on line 3 E> I am running under MacOSX 10.3.2 and PHP 4.3.2. Sounds very much like you have PHP without the image library compiled into it. I don't know where to obtain that lib for the Mac, sorry - but I'm sure someone will. -- Best regards, Richardmailto:[EMAIL PROTECTED] http://www.phpcommunity.org/wiki/296.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] imagecreate undefined...?
I've got this fairly simply script: // white background and blue text $bg = imagecolorallocate($im, 255, 255, 255); $textcolor = imagecolorallocate($im, 0, 0, 255); // write the string at the top left imagestring($im, 5, 0, 0, "Hello world!", $textcolor); // output the image header("Content-type: image/jpg"); imagejpeg($im); ?> However, when I run it, I get an error: Fatal error: Call to undefined function: imagecreate() in [file name] on line 3 I am running under MacOSX 10.3.2 and PHP 4.3.2. Is there anything I should look for in the phpinfo()? Any suggestions on how to fix the problem? Thank you. -- == Eric Gorr = http://www.ericgorr.net = ICQ:9293199 === "Therefore the considerations of the intelligent always include both benefit and harm." - Sun Tzu == Insults, like violence, are the last refuge of the incompetent... === -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ImageCreate / ImageCopyResized Path?
You have started a new thread by taking an existing posting and replying to it while you changed the subject. That is bad, because it breaks threading. Whenever you reply to a message, your mail client generates a "References:" header that tells all recipients which posting(s) your posting refers to. A mail client uses this information to build a threaded view ("tree view") of the postings. With your posting style you successfully torpedoed this useful feature; your posting shows up within an existing thread it has nothing to do with. Always do a fresh post when you want to start a new thread. To achieve this, click on "New message" instead of "Reply" within your mail client, and enter the list address as the recipient. You can save the list address in your address book for convenience. On Thursday 09 October 2003 16:57, [-^-!-%- wrote: > Is it possible to define a path for ImageCreate and/or ImageCopyResize ? > I have an image gallery script that uploads images to the server. I would > like to automatically create thumbnails of the image [as soon as it is > uploaded and saved in a sub-directory. Is this possible with > ImageCreate/ImageCopyResize, or the other functions? [snip] -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Folks playing leapfrog must complete all jumps -- Murphy's Laws on Sex n47 */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ImageCreate / ImageCopyResized Path?
Hello everyone! Is it possible to define a path for ImageCreate and/or ImageCopyResize ? I have an image gallery script that uploads images to the server. I would like to automatically create thumbnails of the image [as soon as it is uploaded and saved in a sub-directory. Is this possible with ImageCreate/ImageCopyResize, or the other functions? My directory structure is ../media /images /thumbs/ I have an upload script that upload images to the media/images/ directory. But, I would like to automatically create a thumbnail of the same image, but saved in the media/images/thumbs directory. Is that possible? The final result would like: ../media/images/ |_image1.jpg |_image2.jpg |_thumbs |_thumb-image1.jpg |_thumb-image2.jpg Any suggestions? FYI: I currently have: $thumb = imagecreate ($w, $h); $image = ImageCreateFromJpeg($img); $imagedata = getimagesize($img); imagecopyresized ($thumb, $image, 0, 0, 0, 0, $w, $h, $imagedata[0], $imagedata[1]); imagejpeg($thumb, $img); This works, but it overwrites the original [uploaded] image with the thumbnail. I want to save the thumbnails in another directory. Am I missing something? Please advise. _john -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] imagecreate() error
YAY Got it working somewhat, now the so called image comes out garbled on the browser!! BUT getting close! "Michelle Bernard" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > no errors have come up yet, still getting the same problem too, I am pulling > out my hair :) everything else works nice and smoothly just this whole gd > thing... > > "Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Do you get any error at apache start up or in error logs? > > > > Michelle Bernard wrote: > > > > > Hi Philip, > > > > > > Thanks for your response, I tried those steps, still no go, getting that > > > same error > > > > > > > > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] imagecreate() error
no errors have come up yet, still getting the same problem too, I am pulling out my hair :) everything else works nice and smoothly just this whole gd thing... "Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Do you get any error at apache start up or in error logs? > > Michelle Bernard wrote: > > > Hi Philip, > > > > Thanks for your response, I tried those steps, still no go, getting that > > same error > > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] imagecreate() error
Do you get any error at apache start up or in error logs? Michelle Bernard wrote: Hi Philip, Thanks for your response, I tried those steps, still no go, getting that same error -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] imagecreate() error
Hi Philip, Thanks for your response, I tried those steps, still no go, getting that same error "Philip Olson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello Michelle- > > a) Only enable one GD dll, so use php_gd2.dll. > b) Consider using imagecreatetruecolor() instead but >either will work. > c) When asking support questions, it's important to >say exactly what version, although in this case >we know it's 4.3.0-1 as php_gd.dll was removed in >PHP 4.3.2 > > Anyway, enable just one dll and it should work. Be sure > to restart the web server afterwards. > > Regards, > Philip > > > On Sat, 12 Jul 2003, Michelle Bernard wrote: > > > Hi there, > > > > I am running PHP 4.3 something or other, I have enabled php_gd.dll and > > php_gd2.dll, pointed the extension directory to the right place, looked at > > the phpinfo and it has the correct information about the gd's being enabled, > > I have tried reintalling apache and php...but still get errors on all simple > > scripts that i have tried... > > > > this is the error I get.. > > > > Fatal error: Call to undefined function: imagecreate() > > > > any suggestions or tips? > > > > Thank you!!! > > > > Sincerely > > Michelle > > > > > > > > -- > > 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
Re: [PHP] imagecreate() error
Hello Michelle- a) Only enable one GD dll, so use php_gd2.dll. b) Consider using imagecreatetruecolor() instead but either will work. c) When asking support questions, it's important to say exactly what version, although in this case we know it's 4.3.0-1 as php_gd.dll was removed in PHP 4.3.2 Anyway, enable just one dll and it should work. Be sure to restart the web server afterwards. Regards, Philip On Sat, 12 Jul 2003, Michelle Bernard wrote: > Hi there, > > I am running PHP 4.3 something or other, I have enabled php_gd.dll and > php_gd2.dll, pointed the extension directory to the right place, looked at > the phpinfo and it has the correct information about the gd's being enabled, > I have tried reintalling apache and php...but still get errors on all simple > scripts that i have tried... > > this is the error I get.. > > Fatal error: Call to undefined function: imagecreate() > > any suggestions or tips? > > Thank you!!! > > Sincerely > Michelle > > > > -- > 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
[PHP] imagecreate() error
Hi there, I am running PHP 4.3 something or other, I have enabled php_gd.dll and php_gd2.dll, pointed the extension directory to the right place, looked at the phpinfo and it has the correct information about the gd's being enabled, I have tried reintalling apache and php...but still get errors on all simple scripts that i have tried... this is the error I get.. Fatal error: Call to undefined function: imagecreate() any suggestions or tips? Thank you!!! Sincerely Michelle -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] imagecreate()
Tell us what is in the logs, they are in logs\ in the apache installation directory Anthony Ritter wrote: Chris, The function I'm trying to get...it's: imagecreate() I am using MS Win 98 / PHP 4 and Apache. I tried running the following script but got an undefined call to imagecreate() The following copy is located in my php.ini file...one of which is: .. ;extension=php_gd.dll .. I tried uncommenting this line to no avail. What is the best way to install php_gd.dll so that I can make use of the image library. Many...many thanks. Tony Ritter --- [This E-mail scanned for viruses by gonefishingguideservice.com] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] imagecreate()
Chris, The function I'm trying to get...it's: imagecreate() I am using MS Win 98 / PHP 4 and Apache. I tried running the following script but got an undefined call to imagecreate() The following copy is located in my php.ini file...one of which is: .. ;extension=php_gd.dll .. I tried uncommenting this line to no avail. What is the best way to install php_gd.dll so that I can make use of the image library. Many...many thanks. Tony Ritter --- [This E-mail scanned for viruses by gonefishingguideservice.com] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] imagecreate()
--- Anthony Ritter <[EMAIL PROTECTED]> wrote: > Fine Chris. > > Maybe you'd be kind enough to explain how I can get that function to work. This is an example of what I am talking about. I would love to help, but you are leaving out way too much information. What function? Why do you think it doesn't work? > I've uncommented the line in the php.ini file. No, don't uncomment that one! Uncomment the other line, then it will work. Just kidding. :-) Hopefully you can see that your question makes as much sense as my answer. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] imagecreate()
Fine Chris. Maybe you'd be kind enough to explain how I can get that function to work. I've uncommented the line in the php.ini file. In "Mastering PHP" (Sybex) on page 559 - Chapter 18, the authors of the textbook - Allen and Hornberger - say when using Win to: ... "uncomment it; that's it. Restart your webserver. That's all it takes." ... Please advise on the steps if you get a chance. Tony Ritter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] imagecreate()
--- Anthony Ritter <[EMAIL PROTECTED]> wrote: > Yes Adam. > Any ideas? > > TR Please write emails that make sense if you are going to send them to the entire list. I have noticed a few of these "me too" type of emails today. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] imagecreate()
Yes Adam. Any ideas? TR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] imagecreate()
Did you restart? On Wed, 2003-02-26 at 12:41, Anthony Ritter wrote: On MS Win 98 / Apache / PHP 4 If somebody out there using Win can check my php.ini file and advise me what I'm doing wrong. I have uncommented: .. extension=php_gd.dll .. and have included: .. extension_dir = C:\php4\extensions I run the php script: header("Content-type:image/png"); $image=imagecreate(200,200); imagepng($image); ?> I receive: X-Powered-By: PHP/4.0.0 Content-type:image/png Fatal error: Call to undefined function: imagecreate() in c:\program files\apache group\apache\htdocs\image.php on line 3 Thank you. TR ... // this is in my php.ini file: ; ; Paths and Directories ; ; include_path = ; UNIX: "/path1:/path2" Windows: "\path1;\path2" doc_root = ; the root of the php pages, used only if nonempty user_dir = ; the directory under which php opens the script using /~username, used only if nonempty ;upload_tmp_dir = ; temporary directory for HTTP uploaded files (will use system default if not specified) upload_max_filesize = 2097152 ; 2 Meg default limit on file uploads extension_dir = C:\php4\extensions; directory in which the loadable extensions (modules) reside ;; ; Dynamic Extensions ; ;; ; if you wish to have an extension loaded automaticly, use the ; following syntax: extension=modulename.extension ; for example, on windows, ; extension=msql.dll ; or under UNIX, ; extension=msql.so ; Note that it should be the name of the module only, no directory information ; needs to go here. Specify the location of the extension with the extension_dir directive above. ;Windows Extensions ;extension=php_mysql.dll ;extension=php_nsmail.dll ;extension=php_calendar.dll ;extension=php_dbase.dll ;extension=php_filepro.dll extension=php_gd.dll ;extension=php_dbm.dll ;extension=php_mssql.dll ;extension=php_zlib.dll ;extension=php_filepro.dll ;extension=php_imap4r2.dll ;extension=php_ldap.dll ;extension=php_crypt.dll ;extension=php_msql2.dll ;extension=php_odbc.dll //this is the php script: header("Content-type:image/png"); $image=imagecreate(200,200); imagepng($image); ?> ... //this is what I get: X-Powered-By: PHP/4.0.0 Content-type:image/png Fatal error: Call to undefined function: imagecreate() in c:\program files\apache group\apache\htdocs\image.php on line 3 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
[PHP] imagecreate()
On MS Win 98 / Apache / PHP 4 If somebody out there using Win can check my php.ini file and advise me what I'm doing wrong. I have uncommented: .. extension=php_gd.dll .. and have included: .. extension_dir = C:\php4\extensions I run the php script: I receive: X-Powered-By: PHP/4.0.0 Content-type:image/png Fatal error: Call to undefined function: imagecreate() in c:\program files\apache group\apache\htdocs\image.php on line 3 Thank you. TR ... // this is in my php.ini file: ; ; Paths and Directories ; ; include_path = ; UNIX: "/path1:/path2" Windows: "\path1;\path2" doc_root = ; the root of the php pages, used only if nonempty user_dir = ; the directory under which php opens the script using /~username, used only if nonempty ;upload_tmp_dir = ; temporary directory for HTTP uploaded files (will use system default if not specified) upload_max_filesize = 2097152 ; 2 Meg default limit on file uploads extension_dir = C:\php4\extensions; directory in which the loadable extensions (modules) reside ;; ; Dynamic Extensions ; ;; ; if you wish to have an extension loaded automaticly, use the ; following syntax: extension=modulename.extension ; for example, on windows, ; extension=msql.dll ; or under UNIX, ; extension=msql.so ; Note that it should be the name of the module only, no directory information ; needs to go here. Specify the location of the extension with the extension_dir directive above. ;Windows Extensions ;extension=php_mysql.dll ;extension=php_nsmail.dll ;extension=php_calendar.dll ;extension=php_dbase.dll ;extension=php_filepro.dll extension=php_gd.dll ;extension=php_dbm.dll ;extension=php_mssql.dll ;extension=php_zlib.dll ;extension=php_filepro.dll ;extension=php_imap4r2.dll ;extension=php_ldap.dll ;extension=php_crypt.dll ;extension=php_msql2.dll ;extension=php_odbc.dll //this is the php script: ... //this is what I get: X-Powered-By: PHP/4.0.0 Content-type:image/png Fatal error: Call to undefined function: imagecreate() in c:\program files\apache group\apache\htdocs\image.php on line 3 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] imageCreate() error
I'm running PHP 4.3 and W2k with IIS 5.0. I have enabled php_gd and it does show up when I do a phpinfo. The php_gd.dll is in the winnt/system32 directory (I've also tried it in almost every other directory too) and I get these error messages: Cannot add header information - headers already sent by (output started at C:\Inetpub\wwwroot\template\index.php:1) in C:\Inetpub\wwwroot\template\index.php on line 3 Fatal error: Call to undefined function: imagecreate() in C:\Inetpub\wwwroot\template\index.php on line 4 Here's the code: Any help would be appreciated. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Imagecreate and/or GD library not activated
check to see if gd is actually activated by using phpinfo() assuming you are using PHP4... /dkm - Original Message - From: "LeTortorec, Jean-Louis" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, May 28, 2002 2:35 PM Subject: [PHP] Imagecreate and/or GD library not activated > Hello everyone. > > I wrote a little code creating PNG images under Apache/PHP windows. > > As the code works fine, I need to transfer it onto the Linux platform. > When I execute the code, PHP replies "Fatal error: Call to undefined > function: imagecreate()". > > I had libgd installed. I just added GD 1.8.4. > The php.ini file says ";extension=gd.so". I removed the comma, restarted > Apache. Does not work. > > I copied libgd.so in /etc/lib/php4 but did not change anything. > > Any idea? > > Thanks. > > Jean-Louis > > > > -- > 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
[PHP] Imagecreate and/or GD library not activated
Hello everyone. I wrote a little code creating PNG images under Apache/PHP windows. As the code works fine, I need to transfer it onto the Linux platform. When I execute the code, PHP replies "Fatal error: Call to undefined function: imagecreate()". I had libgd installed. I just added GD 1.8.4. The php.ini file says ";extension=gd.so". I removed the comma, restarted Apache. Does not work. I copied libgd.so in /etc/lib/php4 but did not change anything. Any idea? Thanks. Jean-Louis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ImageCreate v. ImageCreateTrueColor
Hello, I'm making an Image and I was wondering what the difference is between these two Image constructors. I need to find a way to make dotted and dashed lines (according to different patterns I've been given) and I want the sections between the dots to be transparent. I'm planning on using the ImageSetStyle function. From what I read on PHP.net, some things cannot be used with ImageCreateTrueColor, but it looks like some can only be used that one. One thing I'm interested in is the constant IMG_COLOR_TRANSPARENT - can this be used with ImageCreate? Is there a reason I should use one of the constructors over the other? Thanks! -Natalie Natalie S. Leotta Information Management Services, Inc. (301) 680-9770 [EMAIL PROTECTED]
[PHP] Subject: [PHP] imagecreate with Windows .exe installer
The php_gd.dll is in the extension folder, the error does not show in Apache, it opens with php 4.1.1 running. The error shows on the page in the browser when the page is loaded? I restarted Apache after altering the .ini file? Mike > You need to have that dll installed on your system. You need to download > php-version.zip file that contains all of the dlls in it to run with. > > Ray Hunter > Firmware Engineer > > ENTERASYS NETWORKS > > > -Original Message- > From: Mike Brackenridge [mailto:[EMAIL PROTECTED]] > Sent: Friday, February 22, 2002 10:01 AM > To: [EMAIL PROTECTED] > Subject: [PHP] imagecreate with Windows .exe installer > > > php4 installed with Apache on Windows ME, using as localhost. > > I am trying to use imagecreate with a version of php4 that was installed > with the binary .exe installer, php seems to be installed OK. > > I have changed the .ini file line: > > ;extension=php_gd.dll > > To > > extension=php_gd.dll > > But I get an error of: > > Fatal error: call to undefined function: imagecreate() in c:directory
Re: [PHP] imagecreate with Windows .exe installer
Did you restarted the Apache service? Regards, Andrey Hristov - Original Message - From: "Mike Brackenridge" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, February 22, 2002 7:00 PM Subject: [PHP] imagecreate with Windows .exe installer > php4 installed with Apache on Windows ME, using as localhost. > > I am trying to use imagecreate with a version of php4 that was installed > with the binary .exe installer, php seems to be installed OK. > > I have changed the .ini file line: > > ;extension=php_gd.dll > > To > > extension=php_gd.dll > > But I get an error of: > > Fatal error: call to undefined function: imagecreate() in c:directory > > Has anyone any idea what the problem is here? > > Thanks > Mike > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] imagecreate with Windows .exe installer
You need to have that dll installed on your system. You need to download php-version.zip file that contains all of the dlls in it to run with. Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Mike Brackenridge [mailto:[EMAIL PROTECTED]] Sent: Friday, February 22, 2002 10:01 AM To: [EMAIL PROTECTED] Subject: [PHP] imagecreate with Windows .exe installer php4 installed with Apache on Windows ME, using as localhost. I am trying to use imagecreate with a version of php4 that was installed with the binary .exe installer, php seems to be installed OK. I have changed the .ini file line: ;extension=php_gd.dll To extension=php_gd.dll But I get an error of: Fatal error: call to undefined function: imagecreate() in c:directory Has anyone any idea what the problem is here? Thanks Mike
[PHP] imagecreate with Windows .exe installer
php4 installed with Apache on Windows ME, using as localhost. I am trying to use imagecreate with a version of php4 that was installed with the binary .exe installer, php seems to be installed OK. I have changed the .ini file line: ;extension=php_gd.dll To extension=php_gd.dll But I get an error of: Fatal error: call to undefined function: imagecreate() in c:directory Has anyone any idea what the problem is here? Thanks Mike
[PHP] ImageCreate has failed... help please (urgent)
Hi there... Well, i have php 4.0.6 under windows 98 and i'm havin' some problens to use JPGRAPH 1.2.2 . I have this string as error: "Fatal error: Call to undefined function: imagecreate() in c:\utils\www\graph\jpgraph.php on line 2025" jpgraph.php file: 2025: $this->img = ImageCreate($aWidth, $aHeight); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]