merck_delmoro Posted September 7, 2013 Share Posted September 7, 2013 can any one here know how to resize temporary file image and upload to mysql coz large images is hard to buffer on my school project Quote Link to comment https://forums.phpfreaks.com/topic/281956-how-to-re-size-temporary-image-file-and-upload-to-mysql-blob/ Share on other sites More sharing options...
ignace Posted September 7, 2013 Share Posted September 7, 2013 (edited) 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 terminal4. 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.htmlAPI is available at http://imagine.readthedocs.org/en/latest/_static/API/ Edited September 7, 2013 by ignace Quote Link to comment https://forums.phpfreaks.com/topic/281956-how-to-re-size-temporary-image-file-and-upload-to-mysql-blob/#findComment-1448608 Share on other sites More sharing options...
vinny42 Posted September 7, 2013 Share Posted September 7, 2013 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. Quote Link to comment https://forums.phpfreaks.com/topic/281956-how-to-re-size-temporary-image-file-and-upload-to-mysql-blob/#findComment-1448610 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.