public function find($filter, $path)
    {
        $loader = $this->getLoader($filter);

        $binary = $loader->find($path);
        if (!$binary instanceof BinaryInterface) {
            $mimeType = $this->mimeTypeGuesser->guess($binary);

            $binary = new Binary(
                $binary,
                $mimeType,
                $this->extensionGuesser->guess($mimeType)
            );
        }

        if (null === $binary->getMimeType()) {
            throw new \LogicException(sprintf('The mime type of image %s was not guessed.', $path));
        }

        if (0 !== mb_strpos($binary->getMimeType(), 'image/')) {
            throw new \LogicException(sprintf('The mime type of image %s must be image/xxx got %s.', $path, $binary->getMimeType()));
        }

        return $binary;
    }
public function find($filter, $path)
    {
        $loader = $this->getLoader($filter);

        $binary = $loader->find($path);
        if (!$binary instanceof BinaryInterface) {
            $mimeType = $this->mimeTypeGuesser->guess($binary);

            $binary = new Binary(
                $binary,
                $mimeType,
                $this->extensionGuesser->guess($mimeType)
            );
        }

        if (null === $binary->getMimeType()) {
            throw new \LogicException(sprintf('The mime type of image %s was not guessed.', $path));
        }

        if (0 !== mb_strpos($binary->getMimeType(), 'image/')) {
            throw new \LogicException(sprintf('The mime type of image %s must be image/xxx got %s.', $path, $binary->getMimeType()));
        }

        return $binary;
    }
public function find ( $ filter , $ path ) { $ loader = $ this -> getLoader ( $ filter ) ; $ binary = $ loader -> find ( $ path ) ; if ( ! $ binary instanceof BinaryInterface ) { $ mimeType = $ this -> mimeTypeGuesser -> guess ( $ binary ) ; $ binary = new Binary ( $ binary , $ mimeType , $ this -> extensionGuesser -> guess ( $ mimeType ) ) ; } if ( null === $ binary -> getMimeType ( ) ) { throw new \ LogicException ( sprintf ( 'The mime type of image %s was not guessed.' , $ path ) ) ; } if ( 0 !== mb_strpos ( $ binary -> getMimeType ( ) , 'image/' ) ) { throw new \ LogicException ( sprintf ( 'The mime type of image %s must be image/xxx got %s.' , $ path , $ binary -> getMimeType ( ) ) ) ; } return $ binary ; }
Retrieves an image with the given filter applied.

@param string $filter
@param string $path

@throws \LogicException

@return BinaryInterface
Retrieves an image with the given filter applied .