Setting image using PHPExcel it width is changed

Topics: Developer Forum
Aug 1, 2014 at 8:01 AM
Hello all,
Using PHPExcel library I show image in excel sheet with code like :

  $objDrawingPType = new PHPExcel_Worksheet_Drawing();
  $objDrawingPType->setWorksheet( $this->ExcelActiveSheetObj );
  $objDrawingPType->setName(basename($attach_file));
  $objDrawingPType->setPath($attach_file);
  $cell_coords = $this->int_coordsto_chars( $image_row, $image_col );

  $objDrawingPType->setCoordinates( $cell_coords );
  $objDrawingPType->setOffsetX(0);
  $objDrawingPType->setOffsetY(0);
It works but the image it resized by the width, say if this column is autosized then width of image is bigger then it was in original image. I want this image to keep its size as it is.

When in my Libre Office Version: 4.2.4.2 I select this image and by right menu select "Original Size"
then the image is shown in its original size and looks ok.

If PHPExcel lib has command = "Original Size" ?
I tried command
$objDrawingPType->setResizeProportional(false);
but it does not help. Which is the correct way ?
Aug 24, 2014 at 3:33 PM
Sorry, the question is still active for me.
Is somebody know the answer ?