Code Monkey home page Code Monkey logo

image-symfony's Introduction

Intervention Image Symfony

Symfony Integration for Intervention Image

Latest Version Monthly Downloads

This package provides an integration to setup Intervention Image easily to your Symfony framework application. Although the use of this integration library is not absolutely necessary, it offers a convenient way of central configuration in the Symfony framework.

Requirements

  • Symfony >= 6.4

Installation

In your existing Symfony application you can install this package using Composer.

composer require intervention/image-symfony

After successful installation, you can activate the bundle in the file config/bundes.php of your application by inserting the following line into the array.

return [
    // ...
    Intervention\Image\Symfony\InterventionImageBundle::class => ['all' => true],
];

Configuration

By default, the bundle is configured to use the GD library with Intervention Image. However, the package also offers other drivers. This can be easily configured by creating a file config/packages/intervention_image.yaml and setting the driver class as follows.

intervention_image:
  driver: Intervention\Image\Drivers\Imagick\Driver

You can choose between the two supplied drivers Intervention\Image\Drivers\Gd\Driver and Intervention\Image\Drivers\Imagick\Driver for example.

Getting Started

The integration is now complete and it is possible to access the ImageManager via dependency injection.

namespace App\Controller;

use Intervention\Image\ImageManager;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;

class ExampleController extends AbstractController
{
    #[Route('/')]
    public function example(ImageManager $manager): Response
    {
        $image = $manager->read('images/example.jpg');
    }
}

Read the official documentation of Intervention Image for more information.

Authors

This library is developed and maintained by Oliver Vogel

Thanks to the community of contributors who have helped to improve this project.

License

Intervention Image Symfony is licensed under the MIT License.

image-symfony's People

Contributors

olivervogel avatar szepeviktor avatar

Watchers

 avatar

Forkers

flyingdr

image-symfony's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.