Jump to content

Recommended Posts

1. Download composer.phar from http://getcomposer.org and drop it inside your project directory

2. Create a composer.json file:

 

{
  "require": {
    "imagine/imagine": "0.6.*@dev"
  }
}
3. Run $ /path/to/php composer.phar install in the terminal

4. Use the imagine library:

 

<?php

require_once 'vendor/autoload.php'

$imagine = new Imagine\Gd\Imagine();
$image = $imagine->open('/path/to/image');


$image
  // scale image to 50%
  ->thumbnail($image->getSize()->scale(0.5))
  // display as jpeg at 75%
  ->show('jpeg', array('quality' => 75));
Documentation can be found at http://imagine.readthedocs.org/en/latest/index.html

API is available at http://imagine.readthedocs.org/en/latest/_static/API/

Edited by ignace

the manual also mentiones a few simple but effective resize methods using GD or ImageMagic: http://php.net/manual/en/function.imagecopyresampled.php, which saves you installing an entire image manipulation library when you only need the 20 or-so lines of code of the resize function.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.