public function resize()
    {
        $src = $this->rootDir.DS.str_replace(['/', '\\'], DS, $this->imagePath);   /* read the source image */

        if (!file_exists($src)) {
            throw new \Exception("File not found in given path $src.");
        }

        $info = getimagesize($src); // get the image size
        $path = pathinfo($src);
        $extension = strtolower($path['extension']);

        if (!in_array($extension, $this->imageTypes)) {
            throw new \Exception('File type not supported!');
        }

        $thumbName = is_null($this->thumbName)
            ? $path['basename']
            : $this->thumbName.'.'.$path['extension'];

        $sourceImage = $this->imageCreateFrom(($extension == 'gif') ? 'jpeg' : $extension, $src);
        $thumbImg = $this->changeDimensions($sourceImage, $this->fixedWidth, $this->fixedHeight);
        $this->image($extension, $thumbImg, $thumbName);

        return true;
    }