Jump to content

how to re-size temporary image file and upload to mysql blob


merck_delmoro

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
Link to comment
Share on other sites

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.