30 if (!defined(
'PHPEXCEL_ROOT')) {
34 define(
'PHPEXCEL_ROOT', dirname(__FILE__) .
'/../../');
38 require_once PHPEXCEL_ROOT .
'PHPExcel/IComparable.php';
41 require_once PHPEXCEL_ROOT .
'PHPExcel/Worksheet.php';
44 require_once PHPEXCEL_ROOT .
'PHPExcel/Worksheet/BaseDrawing.php';
47 require_once PHPEXCEL_ROOT .
'PHPExcel/Worksheet/Drawing.php';
120 $this->_resizeProportional =
true;
139 $this->_name = $pValue;
159 $this->_offsetX = $pValue;
179 $this->_offsetY = $pValue;
200 if ($this->_resizeProportional && $pValue != 0) {
202 $this->_height = round($ratio * $pValue);
206 $this->_width = $pValue;
228 if ($this->_resizeProportional && $pValue != 0) {
230 $this->_width = round($ratio * $pValue);
234 $this->_height = $pValue;
255 if ($this->_resizeProportional && !($width == 0 || $height == 0)) {
256 if (($xratio * $this->_height) < $height) {
257 $this->_height = ceil($xratio * $this->_height);
258 $this->_width = $width;
260 $this->_width = ceil($yratio * $this->_width);
261 $this->_height = $height;
283 $this->_resizeProportional = $pValue;
293 return basename($this->_path);
302 return end(explode(
".", basename($this->_path)));
322 public function setPath($pValue =
'', $pVerifyFile =
true) {
324 if (file_exists($pValue)) {
325 $this->_path = $pValue;
327 if ($this->_width == 0 && $this->_height == 0) {
329 list($this->_width, $this->_height) = getimagesize($pValue);
332 throw new Exception(
"File $pValue not found!");
335 $this->_path = $pValue;
385 $this->_hashIndex = $value;
392 $vars = get_object_vars($this);
393 foreach ($vars as
$key => $value) {
394 if (is_object($value)) {
395 $this->
$key = clone $value;
397 $this->
$key = $value;