function __construct($filename = "") { parent::__construct(); if (!empty($filename)) { if (!JFile::exists($filename)) { $this->setError("Image does not exist"); return; } $this->full_path = $filename; $this->setDirectory(substr($this->full_path, 0, strrpos($this->full_path, DS))); $this->proper_name = JFile::getName($filename); if (!empty($this->full_path)) { $image_info = getimagesize($this->full_path); $this->type = $image_info[2]; } } }