title: Adding Image to the Excel in phpexcel in php
body: <p>I am taking the example from <a href="https://phpexcel.codeplex.com/" rel="noreferrer">phpexcel</a></p>
  <p>I just tried with passing value in GET Method, I am done with that.</p>
  <p>Now i am trying to add image in the a3 coloumn.</p>
  <p><strong>Reference Code :</strong></p>
  <pre><code>&lt;?php
  $value = $_GET['value'];
  error_reporting(E_ALL);
  ini_set('display_errors', TRUE);
  ini_set('display_startup_errors', TRUE);
  date_default_timezone_set('Europe/London');
  
  if (PHP_SAPI == 'cli')
      die('This example should only be run from a Web Browser');
  
  require_once dirname(__FILE__) . '/Classes/PHPExcel.php';
  
  
  $objPHPExcel = new PHPExcel();
  
  
  $objPHPExcel-&gt;getProperties()-&gt;setCreator(&quot;Maarten Balliauw&quot;)
                               -&gt;setLastModifiedBy(&quot;Maarten Balliauw&quot;)
                               -&gt;setTitle(&quot;Office 2007 XLSX Test Document&quot;)
                               -&gt;setSubject(&quot;Office 2007 XLSX Test Document&quot;)
                               -&gt;setDescription(&quot;Test document for Office 2007 XLSX, generated using PHP classes.&quot;)
                               -&gt;setKeywords(&quot;office 2007 openxml php&quot;)
                               -&gt;setCategory(&quot;Test result file&quot;);
  
  
  $objPHPExcel-&gt;setActiveSheetIndex(0)
              -&gt;setCellValue('A1', $value)
              -&gt;setCellValue('B2', 'world!')
              -&gt;setCellValue('C1', 'Hello')
              -&gt;setCellValue('D2', 'world!');
  
  
  $objPHPExcel-&gt;setActiveSheetIndex(0)
              -&gt;setCellValue('A4', 'Miscellaneous glyphs')
              -&gt;setCellValue('A5', 'éàèùâêîôûëïüÿäöüç');
  
  $objPHPExcel-&gt;getActiveSheet()-&gt;setTitle('Simple');
  
  
  $objPHPExcel-&gt;setActiveSheetIndex(0);
  header('Content-Type: application/vnd.ms-excel');
  header('Content-Disposition: attachment;filename=&quot;01simple.xls&quot;');
  header('Cache-Control: max-age=0');
  header('Cache-Control: max-age=1');
  
  header ('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past
  header ('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); // always modified
  header ('Cache-Control: cache, must-revalidate'); // HTTP/1.1
  header ('Pragma: public'); // HTTP/1.0
  
  $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
  $objWriter-&gt;save('php://output');
  exit;
  ?&gt;
  </code></pre>
  <p><strong>Example Code for inserting image :</strong></p>
  <pre><code>$gdImage = imagecreatefromjpeg('images/officelogo.jpg');
  // Add a drawing to the worksheetecho date('H:i:s') . &quot; Add a drawing to the worksheet\n&quot;;
  $objDrawing = new PHPExcel_Worksheet_MemoryDrawing();
  $objDrawing-&gt;setName('Sample image');$objDrawing-&gt;setDescription('Sample image');
  $objDrawing-&gt;setImageResource($gdImage);
  $objDrawing-&gt;setRenderingFunction(PHPExcel_Worksheet_MemoryDrawing::RENDERING_JPEG);
  $objDrawing-&gt;setMimeType(PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_DEFAULT);
  $objDrawing-&gt;setHeight(150);
  $objDrawing-&gt;setWorksheet($objPHPExcel-&gt;getActiveSheet());
  $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');$objWriter-&gt;save(str_replace('.php', '.xlsx', __FILE__));
  </code></pre>
  <p>But i don't understanding how to insert the jpg in the a3 coloumn or any other coloumn in the excel file that i import.</p>
  <p><strong>How can i do this ?</strong></p>