/** * [__construct] * @param [string] $file file's dir */ function __construct($file = '', $fopen = false) { if ($file === '') { // } else { self::$file = $file; self::$type = getimagesize(self::$file); //取得图片的大小,类型等 if ($fopen) { self::fopen(); } else { self::$data = file_get_contents($file); } } }