CI_Upload::set_image_properties PHP Метод

set_image_properties() публичный Метод

Uses GD to determine the width/height/type of image
public set_image_properties ( string $path = '' ) : CI_Upload
$path string
Результат CI_Upload
    public function set_image_properties($path = '')
    {
        if ($this->is_image() && function_exists('getimagesize')) {
            if (FALSE !== ($D = @getimagesize($path))) {
                $types = array(1 => 'gif', 2 => 'jpeg', 3 => 'png');
                $this->image_width = $D[0];
                $this->image_height = $D[1];
                $this->image_type = isset($types[$D[2]]) ? $types[$D[2]] : 'unknown';
                $this->image_size_str = $D[3];
                // string containing height and width
            }
        }
        return $this;
    }