Questions tagged [php-imagine]

Image manipulation library for PHP 5.3 inspired by Python's PIL and other image libraries.

ImagineInterface (Imagine\Image\ImagineInterface) and its implementations is the main entry point into Imagine. You may think of it as a factory for Imagine\Image\ImageInterface as it is responsible for creating and opening instances of it and also for instantiating Imagine\Image\FontInterface object.

The main piece of image processing functionality is concentrated in the ImageInterface implementations (one per driver - e.g. Imagick\Image)

The main idea of Imagine is to avoid driver specific methods spill outside of this class and couple of other internal interfaces (Draw\DrawerInterface), so that the filters and any other image manipulations can operate on ImageInterface through its public API.

The main purpose of Imagine is to provide all the necessary functionality to bring all native low level image processing libraries in PHP to the same simple and intuitive OO API.

Several things are necessary to accomplish that:

  • Image manipulation tools, such as resize, crop, etc.
  • Drawing API - to create basic shapes and advanced charts, write text on the image
  • Masking functionality - ability to apply black&white or grayscale images as masks, leading to semi-transparency or absolute transparency of the image the mask is being applied to

The above tools should be the basic foundation for a more powerful set of tools that are called Filters in Imagine.

Useful Links

52 questions
2
votes
1 answer

Imagine with ZF2: Ratio Resize

I am working with the Imagine library in Zend Framework 2: Imagine What I want too do is make some pictures as thumbnails for my picture page, too make it load faster. But the problem is that I don't know how to resize with ratio in the…
kevingoos
  • 3,785
  • 4
  • 36
  • 63
2
votes
1 answer

Problems with Avalanche-imagine in symfony2

I'm trying to create thumbnails with Avalanche-imagine bundle. I'm using OS X 10.7 Lion and MAMP PRO as Apache server. When I call the filter in the twig file, I get a 500 error. Here I put the path manually to check it:
Cebado
  • 115
  • 9
2
votes
2 answers

convert binary data to image using php

I have binary image data saved in my old database, it is saved by my old developer, now i want to display image from that using PHP, but I can not. I have tried imagecreatefromstring but it returns FALSE. Binary example data:…
Kartik it
  • 393
  • 1
  • 5
  • 19
1
vote
2 answers

Php Imagine get Image's width and height

On a personal project I need to get from an object that Implements a ImageInterface (the image) the width and height using the php Imagine library (http://imagine.readthedocs.io). The specific problem that I need to solve is to resize an Image in a…
Dimitrios Desyllas
  • 9,082
  • 15
  • 74
  • 164
1
vote
2 answers

Cropping an image from the center into the largest square you can make in Yii2 Imagine?

I'm using the Yii2 extension Imagine and I need to make 150x150 images from user uploads. Currently I am just doing something like this: use yii\imagine\Image; .... Image::thumbnail($save_path, $img_size, $img_size)->save($save_path); Obviously…
Brett
  • 19,449
  • 54
  • 157
  • 290
1
vote
1 answer

Resizing image to width with Imagine: Call to undefined method Imagine\Gd\Image::widen() in resize.php on line 11

Trying to resize and image to width. This is the code:
Andy
  • 31
  • 4
1
vote
1 answer

Store original temporary uploaded image (to be deleted once filtered) using AWS

I have built an image upload feature using PHP. The implemented scenario was dealing only with local filesystem of the server machine, and now I need to re-implement the feature to fit with AWS. The problem is that AWS offers 3 types of file storage…
Adib Aroui
  • 4,981
  • 5
  • 42
  • 94
1
vote
0 answers

Laravel - Progressive JPEGs are converting to baseline after resized

I am using CodeSleeve/stapler plugin in Laravel for image resizing. I have noticed resized images are not progressive anymore. As Stapler uses Imagine/Imagine Plugin for image handling, I am guessing I need to find solution in terms of imagine…
Ankit
  • 1,867
  • 2
  • 21
  • 40
1
vote
1 answer

Yii2 Imagine border in thumbnail

I have the code: use yii\imagine\Image; use Imagine\Image\Box; ... $path = Yii::getAlias('@app'). '/temp'; Image::frame($path . '/1.jpg')->thumbnail(new Box(200, 200))->save($path . '/2.jpg', ['quality' => 100]); Original image: 1.jpg and result:…
Michael S
  • 11
  • 1
  • 3
1
vote
0 answers

Imagine (imagick) can't open pdf with page parameter

I use Imagine in a Silex environment, In a main objective to create thumbnails from PDF files, I choose the romainneutron/Imagine-Silex-Service-Provider to do this kind of PHP ImageMagick conversion. Everything is OK when I use the Imagick driver…
Julien Malige
  • 3,295
  • 1
  • 20
  • 39
1
vote
0 answers

Liip imagine cant create thumb - with larget than 2MB

So, basically.. I can upload files larger than 2MB (php.ini changed in three different locations - lol..). PHP: 5.6 Symfony Liip Imagine (probably GD driver, dunno how to check it?) memory_limit = 128MB (tryd change to 512MB) upload_max_filesize…
1
vote
0 answers

Out of bound exception in imagine library in YII2

I am getting following exception while uploading some jpg images(not every image) in my YII2 application http://grab.by/H09c It is actually occurring while creating thumb, the full size picture was uploaded well
1
vote
1 answer

How to implement Imagine image library in Codeigniter

I am trying to add the Imagine image library into a Codeigniter application, but this is the first time I have ever encounter the "namespace" and "use" concept which I just don't get. Most Libs usually need an include, require etc... to make them…
d1a8lo24
  • 71
  • 6
1
vote
2 answers

png_compression_level option should be an integer from 0 to 9

I am using Symfony 2.3.* and I got this error in my app/logs/dev.log when I'm using LiipImagineBundle. request.CRITICAL: Uncaught PHP Exception Imagine\Exception\InvalidArgumentException: "png_compression_level option should be an integer from 0 to…
Hendra Huang
  • 528
  • 1
  • 9
  • 16
1
vote
2 answers

Resizing image using Imagine bundle blurs Image

I have the following code: $imagine = new \Imagine\Gd\Imagine(); $image = $imagine->open($src); $image_size = $image->getSize(); $image_height = $image_size->getHeight(); $image_width =…
adit
  • 32,574
  • 72
  • 229
  • 373