/var/www/cobraambalaj/vendor/league/glide/src/Manipulators
NameSizeModeActions
Helpers/-0755rm
Background.php7760644editdlrm
BaseManipulator.php9070644editdlrm
Blur.php8000644editdlrm
Border.php45860644editdlrm
Brightness.php8740644editdlrm
Contrast.php8540644editdlrm
Crop.php22660644editdlrm
Encode.php18310644editdlrm
Filter.php12470644editdlrm
Flip.php7890644editdlrm
Gamma.php8240644editdlrm
ManipulatorInterface.php4470644editdlrm
Orientation.php8230644editdlrm
Pixelate.php8460644editdlrm
Sharpen.php8350644editdlrm
Size.php113700644editdlrm
Watermark.php63100644editdlrm
Edit: /var/www/cobraambalaj/vendor/league/glide/src/Manipulators/Border.php (4586B)
getBorder($image)) { list($width, $color, $method) = $border; if ($method === 'overlay') { return $this->runOverlay($image, $width, $color); } if ($method === 'shrink') { return $this->runShrink($image, $width, $color); } if ($method === 'expand') { return $this->runExpand($image, $width, $color); } } return $image; } /** * Resolve border amount. * @param Image $image The source image. * @return string The resolved border amount. */ public function getBorder(Image $image) { if (!$this->border) { return; } $values = explode(',', $this->border); $width = $this->getWidth($image, $this->getDpr(), isset($values[0]) ? $values[0] : null); $color = $this->getColor(isset($values[1]) ? $values[1] : null); $method = $this->getMethod(isset($values[2]) ? $values[2] : null); if ($width) { return [$width, $color, $method]; } } /** * Get border width. * @param Image $image The source image. * @param double $dpr The device pixel ratio. * @param string $width The border width. * @return double The resolved border width. */ public function getWidth(Image $image, $dpr, $width) { return (new Dimension($image, $dpr))->get($width); } /** * Get formatted color. * @param string $color The color. * @return string The formatted color. */ public function getColor($color) { return (new Color($color))->formatted(); } /** * Resolve the border method. * @param string $method The raw border method. * @return string The resolved border method. */ public function getMethod($method) { if (!in_array($method, ['expand', 'shrink', 'overlay'], true)) { return 'overlay'; } return $method; } /** * Resolve the device pixel ratio. * @return double The device pixel ratio. */ public function getDpr() { if (!is_numeric($this->dpr)) { return 1.0; } if ($this->dpr < 0 or $this->dpr > 8) { return 1.0; } return (double) $this->dpr; } /** * Run the overlay border method. * @param Image $image The source image. * @param double $width The border width. * @param string $color The border color. * @return Image The manipulated image. */ public function runOverlay(Image $image, $width, $color) { return $image->rectangle( $width / 2, $width / 2, $image->width() - ($width / 2), $image->height() - ($width / 2), function ($draw) use ($width, $color) { $draw->border($width, $color); } ); } /** * Run the shrink border method. * @param Image $image The source image. * @param double $width The border width. * @param string $color The border color. * @return Image The manipulated image. */ public function runShrink(Image $image, $width, $color) { return $image ->resize( $image->width() - ($width * 2), $image->height() - ($width * 2) ) ->resizeCanvas( $width * 2, $width * 2, 'center', true, $color ); } /** * Run the expand border method. * @param Image $image The source image. * @param double $width The border width. * @param string $color The border color. * @return Image The manipulated image. */ public function runExpand(Image $image, $width, $color) { return $image->resizeCanvas( $width * 2, $width * 2, 'center', true, $color ); } }