Fixes on ImageField

This commit is contained in:
Antonio de la Rosa 2015-09-16 00:25:28 +02:00
parent fa2fcf359b
commit a37eb49b35

View file

@ -110,6 +110,23 @@ class ImageField extends PhangoField {
//if(make('foo.jpg')->resize(300, 200)->save('bar.jpg');
$real_size=$image->width();
$max_size=0;
if(isset($this->img_width['']))
{
if($this->img_width['']<$real_size)
{
$max_size=$this->img_width[''];
unset($this->img_width['']);
}
}
if($this->thumb)
{
@ -142,6 +159,13 @@ class ImageField extends PhangoField {
$image->reset();
if($max_size>0)
{
$image->fit($max_size);
}
if(!$image->save($this->path.'/'.$name_image))
{