From be24d5d30fabd193a8ad4efa87424f41eee6b442 Mon Sep 17 00:00:00 2001 From: Scott Arciszewski Date: Tue, 25 Feb 2014 16:20:43 -0500 Subject: [PATCH] Update BaseDrawing.php Avoid division by zero --- Classes/PHPExcel/Worksheet/BaseDrawing.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/PHPExcel/Worksheet/BaseDrawing.php b/Classes/PHPExcel/Worksheet/BaseDrawing.php index 0250035c..4820afb8 100644 --- a/Classes/PHPExcel/Worksheet/BaseDrawing.php +++ b/Classes/PHPExcel/Worksheet/BaseDrawing.php @@ -349,7 +349,7 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable public function setHeight($pValue = 0) { // Resize proportional? if ($this->_resizeProportional && $pValue != 0) { - $ratio = $this->_width / $this->_height; + $ratio = $this->_width / ($this->_height !== 0 ? $this->_height : 1); $this->_width = round($ratio * $pValue); }