I can’t understand or fix this problem – PHP

  php

Q(Question):

Warning: getimagesize(images/logo.jpeg) [function.getimagesize]: failed to open stream: No such file or directory in /home/s001898/public_html/loja/admin/fpdf/fpdf.php on line 1213
FPDF error: Missing or incorrect image file: images/logo.jpeg

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']) || $a['channels']==3)
$colspace = 'DeviceRGB';
elseif($a['channels']==4)
$colspace = 'DeviceCMYK';
else
$colspace = 'DeviceGray';
$bpc = isset($a['bits']) ? $a['bits'] : 8;
$data = file_get_contents($file);
return array('w'=>$a[0], 'h'=>$a[1], 'cs'=>$colspace, 'bpc'=>$bpc, 'f'=>'DCTDecode', 'data'=>$data);
}

A(Answer):

try sending absolute path

A(Answer):

Sorry didnt understand your answer.

A(Answer):

say your index.php is in
/var/www/whatever/index.php

your image file is in
/var/www/whatever/images/logo.jpeg

you are sending to FPDF images/logo.jpeg
instead send /var/www/whatever/images/logo.jpeg

also make sure the extension is correct and its an actual jpeg file

A(Answer):

this is the DB line:
INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES
(”, ‘Invoice Print Shop Logo on Invoice’, ‘PDF_INV_SHOW_LOGO’, ‘true’, ‘Should the Sop Logo be printed on the Invoice ? False = No, True = Yes’, 7200, 1, NULL, now(), NULL, ‘tep_cfg_select_option(array(\’true\’, \’false\’), ‘) ,
(”, ‘Invoice location of the shop logo’, ‘PDF_INV_STORE_LOGO’, ‘images/oscommerce.jpeg‘,’Give the location of the ShopeLogo’, 7200, 2, NULL, now(), NULL, NULL),

should i change the location line in bold?

A(Answer):

thats what i said about …..

A(Answer):

Should i emty the line in bold?or give another place?

LEAVE A COMMENT