ID:               38108
 Updated by:       [EMAIL PROTECTED]
 Reported By:      bcarlowise at yahoo dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         GD related
 Operating System: SuSE Enterprise Linux 10.0
 PHP Version:      5.1.4
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.




Previous Comments:
------------------------------------------------------------------------

[2006-07-15 01:44:11] bcarlowise at yahoo dot com

Description:
------------
Scenario:

  I have a MySQL database with a table that I store photos in. I am
trying to extract the photo from the database and display the photo in
a web page. I can get the code to display the raw stream if I "echo"
the variable but it will not display the actual photo when I call the
imagecreatefromjpeg and imagejpeg functions and pass the arguments
according to the documentation.

SuSE Linux Enterprise 10.0
Apache 2.2.0-21.2
PHP 5.1.2-29 (php5-gd module installed)
GD 2.0.32-23


Reproduce code:
---------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml";>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"
/>
<title>Image Display Test</title>
</head>

<body>


<?php

$db=mysql_connect("<server>", "<username>", "<password>") or
die(mysql_error());
mysql_select_db("<schema>") or die(mysql_error());

$sql = "Select * from <table> where id= 1";
$result = mysql_query($sql);

//if (!$result) {
//    die('Invalid query: ' . mysql_error());
//}
//Else

$myrow = mysql_fetch_array($result);

$id = $myrow[0];
$gallery = $myrow[1];
$image = $myrow[2];
$hits = $myrow[3];

echo "id=$id", ", gallery=$gallery", ", hits=$hits";

if ($image!=false) {

  echo $image;   //**this will produce the raw stream**

  $source = imagecreatefromjpeg($image);
  imagejpeg($source, $source, 75);  //**this displays nothing but
should display the image??**

  exit;
}

Else
  echo "No valid image found.";

?>

<p>&nbsp;

</p>
</body>
</html>

Expected result:
----------------
To have the photo displayed in the browser.

Actual result:
--------------
the raw stream is displayed from the echo statement but nothing is
displayed from the imagejpeg function.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=38108&edit=1

Reply via email to