What is the wrong with this syntax using php to make an image output on pdf format?

ed_biasbas

New member
What is the wrong with this syntax using php to make an image output on pdf format?

The pict is a mysql fieldname which content images such as image1.jpg and so on... while thumbmark thumb1.jpg and so on.. both were saved on the same directory where the php codes were saved.

It works on text fieldname such as name, age, address when searched... but with the image, it didn't work...

$pdf->ln(7);
$pdf->Image($GetData['pict'],73,200,30);
$pdf->Image($GetData['thumbmark'],105,200,16);


The result:

Warning: getimagesize: Unable to open 'image5.jpg' for reading. in c:\documents and settings\amalia\desktop\server2011\munisipyo2010\edwin2007334356879\html2pdf_lib\fpdf.php on line 1466
FPDF error: Missing or incorrect image file: image5.jpg



image5.jpg is available inside that folder.



The content of fpdf.php where it points the error message


function _parsejpg($file)
{
//Extract info from a JPEG file
$a=GetImageSize($file);
if(!$a)
$this->Error('Missing or incorrect image file: '.$file);
if($a[2]!=2)
$this->Error('Not a JPEG file: '.$file);
if(!isset($a['channels']) or $a['channels']==3)
$colspace='DeviceRGB';
elseif($a['channels']==4)
$colspace='DeviceCMYK';
else
$colspace='DeviceGray';
$bpc=isset($a['bits']) ? $a['bits'] : 8;
//Read whole file
$f=fopen($file,'rb');
$data='';
while(!feof($f))
$data.=fread($f,4096);
fclose($f);
return array('w'=>$a[0],'h'=>$a[1],'cs'=>$colspace,'bpc'=>$bpc,'f'=>'DCTDecode','data'=>$data);
}
image5.jpg is one sample with the fieldname "pict"

In short, calling a certain record image on "pict" and displaying on pdf form using php mysql and saved images on a folder with the same filename that saved on "pict"
 
Back
Top