Symfony - Working with images?

1

I need to create an image with php, I'd like to know if Simfony has any library or something already included in it to work with the GD / ImageMagick functions. I've been searching and seen "LiipImagineBundle", but it seems to me very limited, for example I do not know if I can create an image with this library. Does anyone know about any library or even about this LiipImagineBundle? Thanks.

    
asked by anonymous 09.01.2017 / 18:44

2 answers

0

For the treatment of images there are several libraries available. The LiipImagineBundle has the general purpose of making the task of serving images easier. In your case, for imaging, I believe it will not serve.

I did a quick search and found the phpixie / image that seemed to me to be very simple and functional. The Gregwar / image library also seems like a great option.

I have not used any of them so my review is limited to API and documentation available.

If you want to search more libraries, the packagist site has several options.

    
07.02.2017 / 17:44
0

You do not necessarily need to use Symfony bundles. In Symfony it is possible to install components via composer and just use the Class on your Controller.

Third-party image manipulation components: Intervention Imanee

You install with the composer:

composer require imanee/imanee

E Uses within the method in Controller:

$imanee = new \Imanee('test.jpg');
echo $imanee->thumbnail(200, 200, true)
    ->output();

NOTE: To instantiate Classes in Symfony you must use "\".

    
15.02.2017 / 18:56