[PHP] PHP displaying images
Hello I am trying to use GD to create and manipulate images but the statement: header (Content-type: image/jpg); generates the error message: The image http://localhost/gdtst2.php; cannot be displayed, because it contains errors. There is no error message in the ../httpd/error_log file. I am using PHP 5.0.3 with GD 2.0.28. The report from phpinfo() indicates gd present and enabled. Other nongraphics content-types do not gererate errors. Code used was First Program from tutorial at http://www.phpfreaks.com/tutorials/105/1.php. Similar code from php manual generates the same error. I suspect the solution is simple but I'm just not seeing it! Help Ian Johnson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP displaying images
Ian Johnson wrote: I am trying to use GD to create and manipulate images but the statement: header (Content-type: image/jpg); generates the error message: The image http://localhost/gdtst2.php; cannot be displayed, because it contains errors. contains errors here means It's not a valid JPEG So comment out the header() and see if you see any error messages then. After it looks like it's a JPEG (starts with yoya) put the header() line back in. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP displaying images
On Saturday 29 January 2005 10:13, Ian Johnson wrote: There is no error message in the ../httpd/error_log file. That looks like the Apache error log file, which is most likely not what you want to be looking at. You want the PHP error log, see settings in php.ini, and check phpinfo(). -- 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 -- New Year Resolution: Ignore top posted posts -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP displaying images
This does the same for png as well. No errors are generated when header () is commented out or other content-types are specified Ian Johnson On Fri, 2005-01-28 at 20:45 -0800, Richard Lynch wrote: Ian Johnson wrote: I am trying to use GD to create and manipulate images but the statement: header (Content-type: image/jpg); generates the error message: The image http://localhost/gdtst2.php; cannot be displayed, because it contains errors. contains errors here means It's not a valid JPEG So comment out the header() and see if you see any error messages then. After it looks like it's a JPEG (starts with yoya) put the header() line back in. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP displaying images
Jason Wong wrote: On Saturday 29 January 2005 10:13, Ian Johnson wrote: There is no error message in the ../httpd/error_log file. That looks like the Apache error log file, which is most likely not what you want to be looking at. You want the PHP error log, see settings in php.ini, and check phpinfo(). My php is configured to write error messages to the http error_log and not to display errors. In this case the error is displayed and not logged. Note that there is no problem with the code from phpfreaks. It seems to run for everyone else on their computers. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP displaying images
On Saturday 29 January 2005 13:42, Ian Johnson wrote: My php is configured to write error messages to the http error_log and not to display errors. OK. In this case the error is displayed and not logged. If you're referring to this ... The image http://localhost/gdtst2.php; cannot be displayed, because it contains errors. ... then I'm pretty sure that is generated by your browser and not by the server. When using the image functions I always have them save to file initially, then when I know that my code is 100% correct and the saved images are viewable *then* I output them directly. Note that there is no problem with the code from phpfreaks. It seems to run for everyone else on their computers. In that case you're doing something different to everyone else, find out what that difference is. -- 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 -- New Year Resolution: Ignore top posted posts -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php and images
I have problem with jpg pictures in php pages. Path and picture is correct but when i want see picture in php script picture don't show. I use PHP4.3.4 on apache server 2.0.44 on Windopws 2000 Server. Thanks for help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php and images
I have a certain difficulties in case of processing large images thru GD2 library. GD2 has some problems with image processing and it results in some exception and GD just crashes. I have to mention, that the crash causes whole php interpreter to crash and execution of the script is terminated without any warning or handlable event :(... I don't know for certain now, which command causes it, but it seems that imagecopyresampled is the origin of the problems. So if you are using GD2 with large images, this may be the issue. regards, m. Roman Duriancik wrote: I have problem with jpg pictures in php pages. Path and picture is correct but when i want see picture in php script picture don't show. I use PHP4.3.4 on apache server 2.0.44 on Windopws 2000 Server. Thanks for help. -- Miroslav Hudak developer designer http://hudak.info -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP MSSQL Images
* Thus wrote [EMAIL PROTECTED] ([EMAIL PROTECTED]): ... The following is the tag inserted to my webpage: img src=showpic.php?picid=1 View the source of this image to see if any php errors are being displayed. Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP MSSQL Images
Hey .. I am having a problem when i try to pull an image that has been stored in MS SQL Server from displaying properly. I know, its a waste of space to store the actual image in SQL, but this is the way it needs to be done to be compatible with some of the other systems. Anyway, if you have any input at all as to what could be wrong, please let me know. I will provide my system information and code below for your review. Thanks. Platform: Linux Redhat 9 PHP Version 4.3.1 FreeTDS 0.61 (used to connect to Microsoft SQL Server) SQL Server 2000 Here is my code (except for connection information, of course) showpic.php ? $eventid=$_GET[picid]; $dsource = SQL IP; $sqluser = Username; $sqlpass = Password; $catalog = Database; [EMAIL PROTECTED]($dsource,$sqluser,$sqlpass) or die(Could not connect to the database); @mssql_select_db($catalog) or die (invalid); $getpic = mssql_query(select Picture from GetPics where Id='$eventid') or die(Query is not achievable by SQL Server) or die(invalid); while($rs=mssql_fetch_array($getpic)) { header(Content-type: image/jpeg); $image=$rs[Picture]; print $image; } ? The following is the tag inserted to my webpage: img src=showpic.php?picid=1 Please let me know if you have any ideas, and if you dont, thanks for your help anyway. Chris [EMAIL PROTECTED]
[PHP] PHP, DB, images, ODBC
Hi, I'm working with PHP and ODBC to get images stored in a database (Blob fields). But I experiment little problems to display these pics. Has anyone any information about PHP/ODBC/images ? Thanks, Bilbo
Re: [PHP] PHP and Images stored in mysql
How can I echo an image from other location than the mysql using this kind of script?? since I'm using php to output the image from database, there's a way to change it to a ftp link for example if image doesn't exists?? this is my script: ? $sql = SELECT Imagem_data,Imagem_type FROM imagens WHERE CelebID='$celebID'; $query = new Query($conexao); $query-executa($sql); $resultado = $query-dados(); mysql_close(); $imagem_banco = $resultado['Imagem_data']; $type = $resultado['Imagem_type']; if($imagem_banco != ) { HEADER(Content-type: $type); echo($imagem_banco); } } ? and I call it from my page with img src=lib_image.php?celebID='1'. Thank's Rodrigo on 1/9/02 9:16 PM, Bogdan Stancescu at [EMAIL PROTECTED] wrote: My way around this is using two fallback stages: for one you test mysql_num_rows() after performing the query. If that's 0, use a default image placed in the database beforehand. If that also returns a null mysql_num_rows() then echo an image (probably the same default) from a known location in the filesystem. HTH Bogdan Rodrigo Peres wrote: Hi list, I have some images stored in a blob in mysql. I've made this code to output them to html, but the problem is if there's no image at a given id the page tooks a long time to load and display the broken image, there's a way to avoid this, I mean, there's a way to print a message or another image if there's none in mysql ??? -- -- 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]
[PHP] PHP and Images stored in mysql
Hi list, I have some images stored in a blob in mysql. I've made this code to output them to html, but the problem is if there's no image at a given id the page tooks a long time to load and display the broken image, there's a way to avoid this, I mean, there's a way to print a message or another image if there's none in mysql ??? ? $sql = SELECT Imagem_data,Imagem_type FROM imagens WHERE CelebID='$celebID'; $query = new Query($conexao); $query-executa($sql); $resultado = $query-dados(); mysql_close(); $imagem_banco = $resultado['Imagem_data']; $type = $resultado['Imagem_type']; if($imagem_banco != ) { HEADER(Content-type: $type); echo($imagem_banco); } } ? Thank's in advance Rodrigo -- -- 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]
Re: [PHP] PHP and Images stored in mysql
My way around this is using two fallback stages: for one you test mysql_num_rows() after performing the query. If that's 0, use a default image placed in the database beforehand. If that also returns a null mysql_num_rows() then echo an image (probably the same default) from a known location in the filesystem. HTH Bogdan Rodrigo Peres wrote: Hi list, I have some images stored in a blob in mysql. I've made this code to output them to html, but the problem is if there's no image at a given id the page tooks a long time to load and display the broken image, there's a way to avoid this, I mean, there's a way to print a message or another image if there's none in mysql ??? -- 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]