public function cropFaceToJpeg($outFileName = null)
    {
        if (empty($this->face)) {
            throw new NoFaceException('No face detected');
        }

        $canvas = imagecreatetruecolor($this->face['w'], $this->face['w']);
        imagecopy($canvas, $this->canvas, 0, 0, $this->face['x'], $this->face['y'], $this->face['w'], $this->face['w']);

        if ($outFileName === null) {
            header('Content-type: image/jpeg');
        }

        imagejpeg($canvas, $outFileName);
    }