I can't understand or fix this problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • salvador72
    New Member
    • Apr 2012
    • 7

    I can't understand or fix this problem

    Warning: getimagesize(im ages/logo.jpeg) [function.getima gesize]: 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


    Code:
    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);
    }
    Last edited by PsychoCoder; Apr 22 '12, 05:14 AM.
  • johny10151981
    Top Contributor
    • Jan 2010
    • 1059

    #2
    try sending absolute path

    Comment

    • salvador72
      New Member
      • Apr 2012
      • 7

      #3
      Sorry didnt understand your answer.

      Comment

      • johny10151981
        Top Contributor
        • Jan 2010
        • 1059

        #4
        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

        Comment

        • salvador72
          New Member
          • Apr 2012
          • 7

          #5
          this is the DB line:
          INSERT INTO configuration (configuration_ id, configuration_t itle, configuration_k ey, configuration_v alue, configuration_d escription, configuration_g roup_id, sort_order, last_modified, date_added, use_function, set_function) VALUES
          ('', 'Invoice Print Shop Logo on Invoice', 'PDF_INV_SHOW_L OGO', '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?

          Comment

          • johny10151981
            Top Contributor
            • Jan 2010
            • 1059

            #6
            thats what i said about .....

            Comment

            • salvador72
              New Member
              • Apr 2012
              • 7

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

              Comment

              Working...