public function getType()
{
if (!$this->handle) {
return false;
}
$this->strpos = 0;
if (!$this->type) {
switch ($this->getChars(2)) {
case "BM":
return $this->type = 'bmp';
case "GI":
return $this->type = 'gif';
case chr(0xff) . chr(0xd8):
return $this->type = 'jpeg';
case chr(0x89) . 'P':
return $this->type = 'png';
default:
return false;
}
}
return $this->type;
}