src/GuillermoMartinez/Filemanager/Filemanager.php
public function getImageCalSize($imagesize=array(),$image_config=array())
    {
        $r = array();
        if(count($imagesize)>0 && isset($imagesize[0],$imagesize[1]) && count($image_config)>0){
            if ($image_config[2]===true && $image_config[3]===null) {
                $por =  $image_config[0] / $imagesize[0];
                $height = round($imagesize[1] * $por);
                $r[0] = $image_config[0];
                $r[1] = $height;
            }elseif ($image_config[2]===null && $image_config[3]===true) {
                $por =  $image_config[1] / $imagesize[1];
                $width = round($imagesize[0] * $por);
                $r[0] = $width;
                $r[1] = $image_config[1];
            }else{
                $r[0] = $image_config[0];
                $r[1] = $image_config[1];
            }
        }
        return $r;
    }
public function getImageCalSize($imagesize=array(),$image_config=array())
    {
        $r = array();
        if(count($imagesize)>0 && isset($imagesize[0],$imagesize[1]) && count($image_config)>0){
            if ($image_config[2]===true && $image_config[3]===null) {
                $por =  $image_config[0] / $imagesize[0];
                $height = round($imagesize[1] * $por);
                $r[0] = $image_config[0];
                $r[1] = $height;
            }elseif ($image_config[2]===null && $image_config[3]===true) {
                $por =  $image_config[1] / $imagesize[1];
                $width = round($imagesize[0] * $por);
                $r[0] = $width;
                $r[1] = $image_config[1];
            }else{
                $r[0] = $image_config[0];
                $r[1] = $image_config[1];
            }
        }
        return $r;
    }
public function getImageCalSize ( $ imagesize = array ( ) , $ image_config = array ( ) ) { $ r = array ( ) ; if ( count ( $ imagesize ) > 0 && isset ( $ imagesize [ 0 ] , $ imagesize [ 1 ] ) && count ( $ image_config ) > 0 ) { if ( $ image_config [ 2 ] === true && $ image_config [ 3 ] === null ) { $ por = $ image_config [ 0 ] / $ imagesize [ 0 ] ; $ height = round ( $ imagesize [ 1 ] * $ por ) ; $ r [ 0 ] = $ image_config [ 0 ] ; $ r [ 1 ] = $ height ; } elseif ( $ image_config [ 2 ] === null && $ image_config [ 3 ] === true ) { $ por = $ image_config [ 1 ] / $ imagesize [ 1 ] ; $ width = round ( $ imagesize [ 0 ] * $ por ) ; $ r [ 0 ] = $ width ; $ r [ 1 ] = $ image_config [ 1 ] ; } else { $ r [ 0 ] = $ image_config [ 0 ] ; $ r [ 1 ] = $ image_config [ 1 ] ; } } return $ r ; }
Calcula las dimensiones de la imagen
@param  array  $imagesize    dimension de la imagen
@param  array  $image_config dimensiones de la imagen
@return array               dimension de la nueva imagen
Calcula las dimensiones de la imagen