选择语言 :

 Core_Upload::set_image_properties

如果是图片则获取图片相关参数

Upload Core_Upload::set_image_properties( )
返回值
  • Upload
File: ./core/classes/upload.class.php
public function set_image_properties()
{
    if ($this->is_image() && function_exists('getimagesize'))
    {
        if (false !== ($D = @getimagesize($this->file['temp'])))
        {
            $types = array
            (
                1 => 'gif',
                2 => 'jpeg',
                3 => 'png',
                4 => 'bmp',
            );

            $this->file['image']['width']    = $D['0'];
            $this->file['image']['height']   = $D['1'];
            $this->file['image']['type']     = (!isset($types[$D['2']])) ? 'unknown' : $types[$D['2']];
            $this->file['image']['size_str'] = $D['3'];
        }
    }

    return $this;
}