public function addWatermark($watermark_path = null)
    {
        if (is_null($watermark_path)) {
            $watermark_path = $this->watermarkPath();
        }
        $watermark = \Intervention\Image\Facades\Image::make($watermark_path);
        $watermark_width = config('images.watermark_width');
        $watermark_height = config('images.watermark_height');

        /* % to px */
        $watermark_resolution = $this->calculateWatermarkResolution(
            $watermark_width,
            $watermark_height,
            $watermark,
            $this->handle()
        );

        /* fit watermark */
        $watermark->resize($watermark_resolution->width, $watermark_resolution->height, function ($constraint) {
            $constraint->aspectRatio();
        });

        $this->handle()->insert($watermark, config('images.watermark_position'));
    }
public function addWatermark($watermark_path = null)
    {
        if (is_null($watermark_path)) {
            $watermark_path = $this->watermarkPath();
        }
        $watermark = \Intervention\Image\Facades\Image::make($watermark_path);
        $watermark_width = config('images.watermark_width');
        $watermark_height = config('images.watermark_height');

        /* % to px */
        $watermark_resolution = $this->calculateWatermarkResolution(
            $watermark_width,
            $watermark_height,
            $watermark,
            $this->handle()
        );

        /* fit watermark */
        $watermark->resize($watermark_resolution->width, $watermark_resolution->height, function ($constraint) {
            $constraint->aspectRatio();
        });

        $this->handle()->insert($watermark, config('images.watermark_position'));
    }
public function addWatermark ( $ watermark_path = null ) { if ( is_null ( $ watermark_path ) ) { $ watermark_path = $ this -> watermarkPath ( ) ; } $ watermark = \ Intervention \ Image \ Facades \ Image :: make ( $ watermark_path ) ; $ watermark_width = config ( 'images.watermark_width' ) ; $ watermark_height = config ( 'images.watermark_height' ) ; /* % to px */ $ watermark_resolution = $ this -> calculateWatermarkResolution ( $ watermark_width , $ watermark_height , $ watermark , $ this -> handle ( ) ) ; /* fit watermark */ $ watermark -> resize ( $ watermark_resolution -> width , $ watermark_resolution -> height , function ( $ constraint ) { $ constraint -> aspectRatio ( ) ; } ) ; $ this -> handle ( ) -> insert ( $ watermark , config ( 'images.watermark_position' ) ) ; }
Add watermark to image. Opacity should be set in watermark file.

@param string $watermark_path Path to watermark image file

@return this
Add watermark to image . Opacity should be set in watermark file .