public function imageBorder($params)
    {
        if (is_array($params)) {
            $filename = $params['source'];
            $ext = $this->imageExtension($filename);
            if ($ext === 'png') {
                $image = imagecreatefromstring(file_get_contents($filename));
            } elseif ($ext === 'jpeg') {
                $image = imagecreatefromjpeg($filename);
            } elseif ($ext === 'gif') {
                $image = imagecreatefromgif($filename);
            } else {
                return false;
            }
            $border_colors = imagecolorallocate($image, $params['bg_color']['red'], $params['bg_color']['green'], $params['bg_color']['blue']);
            $x = 0;
            $y = 0;
            $w = imagesx($image) - 1;
            $h = imagesy($image) - 1;
            imagesetthickness($image, $params['thickness']);
            //left
            imageline($image, $x, $y, $x, $y + $h, $border_colors);
            //top
            imageline($image, $x, $y, $x + $w, $y, $border_colors);
            //right
            imageline($image, $x + $w, $y, $x + $w, $y + $h, $border_colors);
            //bottom
            imageline($image, $x, $y + $h, $x + $w, $y + $h, $border_colors);
            imagejpeg($image);
            if (isset($params['save']) and $params['save'] === true) {
                $this->imageSave([
                    'image'  => $image,
                    'target' => $params['target'], ]);
            }
            imagedestroy($image);
        } else {
            return false;
        }
    }