src/Manipulators/Watermark.php
public function getImage(Image $image)
    {
        if (is_null($this->watermarks)) {
            return;
        }

        if (!is_string($this->mark)) {
            return;
        }

        if ($this->mark === '') {
            return;
        }

        $path = $this->mark;

        if ($this->watermarksPathPrefix) {
            $path = $this->watermarksPathPrefix.'/'.$path;
        }

        if ($this->watermarks->has($path)) {
            $source = $this->watermarks->read($path);

            if ($source === false) {
                throw new FilesystemException(
                    'Could not read the image `'.$path.'`.'
                );
            }

            return $image->getDriver()->init($source);
        }
    }
public function getImage(Image $image)
    {
        if (is_null($this->watermarks)) {
            return;
        }

        if (!is_string($this->mark)) {
            return;
        }

        if ($this->mark === '') {
            return;
        }

        $path = $this->mark;

        if ($this->watermarksPathPrefix) {
            $path = $this->watermarksPathPrefix.'/'.$path;
        }

        if ($this->watermarks->has($path)) {
            $source = $this->watermarks->read($path);

            if ($source === false) {
                throw new FilesystemException(
                    'Could not read the image `'.$path.'`.'
                );
            }

            return $image->getDriver()->init($source);
        }
    }
public function getImage ( Image $ image ) { if ( is_null ( $ this -> watermarks ) ) { return ; } if ( ! is_string ( $ this -> mark ) ) { return ; } if ( $ this -> mark === '' ) { return ; } $ path = $ this -> mark ; if ( $ this -> watermarksPathPrefix ) { $ path = $ this -> watermarksPathPrefix . '/' . $ path ; } if ( $ this -> watermarks -> has ( $ path ) ) { $ source = $ this -> watermarks -> read ( $ path ) ; if ( $ source === false ) { throw new FilesystemException ( 'Could not read the image `' . $ path . '`.' ) ; } return $ image -> getDriver ( ) -> init ( $ source ) ; } }
Get the watermark image.
@param  Image      $image The source image.
@return Image|null The watermark image.
Get the watermark image .