mesavolt/imaging-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

mesavolt/imaging-bundle

Composer 安装命令:

composer require mesavolt/imaging-bundle

包简介

Symfony bundle to facilitate image manipulation in PHP

README 文档

README

Build Status Coverage Status

Installation

Use composer:

composer require mesavolt/imaging-bundle

Applications that don't use Symfony Flex

If you don't use Symfony Flex, you need to enable the bundle by hand. To to so, add it to the list of registered bundles in the app/AppKernel.php file of your project:

<?php
// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Mesavolt\ImagingBundle\ImagingBundle(),
        );
        // ...
    }
    // ...
}

Configuration

The following options are available to customize the behavior of the bundle's imaging service :

Option name Default value Role
imaging.transparency_replacement #FFFFFF The color used to replace transparent areas

Usage

Inject the Mesavolt\ImagingBundle\ImagingService service into your services and controllers (or get the mesavolt.imaging service from the container) :

<?php

namespace App;


use Mesavolt\ImagingBundle\Service\ImagingService;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;

class HomeController extends AbstractController
{
    public function index(ImagingService $imagingService)
    {
        $relative = '/public/thumbnails/thumbnail.jpeg';
        $path = $this->getParameter('kernel.project_dir').$relative;
        $imagingService->shrink('/tmp/image.jpg', $path);
        
        return $this->render('home/index.html.twig', [
            'shrunk' => $relative
        ]);
    }
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-08-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固