示例#1
0
 /**
  * 取得图像属性
  *
  * @return array 错误时返回false
  * @author Lijun
  */
 public function getImageAttr()
 {
     if (self::imageNull()) {
         return false;
     }
     $fn = tempnam(SAE_TMP_PATH, "SAE_IMAGE");
     if ($fn == false) {
         self::$_errmsg = "tempnam call failed when getImageAttr";
         return false;
     }
     if (!file_put_contents($fn, self::$_img_data)) {
         self::$_errmsg = "file_put_contents to SAETMP_PATH failed when getImageAttr";
         return false;
     }
     if (!($size = getimagesize($fn, $info))) {
         self::$_errmsg = "getimagesize failed when getImageAttr";
         return false;
     }
     foreach ($info as $k => $v) {
         $size[$k] = $v;
     }
     self::$_width = $size[0];
     self::$_height = $size[1];
     return $size;
 }