X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=blobdiff_plain;f=DataObjects%2FImages.php;fp=DataObjects%2FImages.php;h=f2c39c3525dcedb607cff4269aecd56ea5b3daaa;hp=39171b102197506af2025bac7c271f8fb09474a0;hb=d0be1b08073ff663c709f03f6357caf399a61e69;hpb=0be732fbb3ae165c64fcf96770586143fd1efecc diff --git a/DataObjects/Images.php b/DataObjects/Images.php index 39171b10..f2c39c35 100644 --- a/DataObjects/Images.php +++ b/DataObjects/Images.php @@ -536,9 +536,10 @@ class Pman_Core_DataObjects_Images extends DB_DataObject //$size = min(1024, (int) $size); // the size should 200x150 to convert $sizear = preg_split('/(x|c)/', $size); - if(empty($sizear[1])){ - $sizear[1] = 0; + if(!isset($sizear[1])){ + $sizear[1] = 0; // 0x with '0' is a box? why } + $size = implode(strpos($size,'c') > -1 ? 'c' : 'x', $sizear); // print_r($size); $fc = $this->toFileConvert(); @@ -600,7 +601,7 @@ class Pman_Core_DataObjects_Images extends DB_DataObject * * */ - function toHTML($size, $provider = '/Images/Thumb') + function toHTML($size, $provider = '/Images/Thumb', $extra = '') { @@ -615,12 +616,12 @@ class Pman_Core_DataObjects_Images extends DB_DataObject } if (empty($sz[1])) { $ratio = empty($this->width) ? 1 : $this->height/ ($this->width *1.0); - $sy = $ratio * $sx; + $sy = intval($ratio * $sx); } else { $sy = $sz[1]; } // create it? - $extra = ''; + if (strlen($this->title)) { $extra = ' title="'. htmlspecialchars($this->title) . '"'; }