/// 許可可能な画像である function isAcceptImage() { if (!array_key_exists('file', $_FILES)) { $this->errorMessage = 'ファイルが選択されていません。ファイルを選択し直して下さい。'; return false; } $image = getimagesize($_FILES['file']['tmp_name']); $size = array($image[0],$image[1]); $type = $image[2]; if ( ($type !== IMAGETYPE_PNG) && ($type !== IMAGETYPE_GIF) && ($type !== IMAGETYPE_JPEG) ) { $this->errorMessage = '未対応の画像形式です。画像形式を変更して再実行して下さい。'; return false; } if (array($this->acceptWidth(), $this->acceptHeight()) !== $size) { $this->errorMessage = '画像のサイズは' . $this->acceptWidth() . 'x' . $this->acceptHeight() . 'のものを指定して下さい。'; return false; } return true; }