定制 flazzarotto/binary-filter 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

flazzarotto/binary-filter

Composer 安装命令:

composer require flazzarotto/binary-filter

包简介

Easy Liip Imagine server-side image filter for both files and binary data

README 文档

README

This Symfony3 bundle use liip/imagine to allow easy php-side image filter.

## Set up

  1. Run composer require flazzarotto/binary-filter

  2. Modify you AppKernel.php:

    $bundles = [
      // add following lines
      new \Liip\ImagineBundle\LiipImagineBundle(),
      new Flazzarotto\BinaryFilterBundle\BinaryFilterBundle()
    ];
  3. Configure your filters the same way you do with liip, but using our binary image loader as data loader. For example:

    # config.yml
    liip_imagine :
        # your filter sets are defined here
        filter_sets :
            # use the default cache configuration
            cache : ~
    
            my_filter:
                data_loader: binary_image_data_loader
                filters:
                    thumbnail:
                        size: [1920, 1080]
                        mode: outbound

HOW TO USE

The main goal of this package is to allow you to resize, generate thumbnails on the fly, in controllers, commands, services... You can provide both binary data and filepaths to the service.

Example:

$filter = $this->get('image.back_filter'); // the BinaryFilter service

$filter ->setDefaultFilter('my_filter') // filter as defined in your config.yml - optional

        ->loadBinary($data,$outputFile) // $data as binary, $outputFile as path relative to directory - return a BinaryFilter object
        // OR
        ->loadFile($path) // provide absolute path to your input image - return a BinaryFilter object

        ->applyFilter($filter) // you can override default filter - optional if default filter has been given
        
        ->getMimeType(); // optional; useful to determine extension or for direct download
        
        ->outputFile(true); // save filtered image to output file; set parameter to true to allow overriding if file exists
        // OR
        ->getFilteredBinary(); // returns picture as binary data

统计信息

  • 总下载量: 44
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2016-12-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固