* Copyright (c) 2009, Ian Selby/Gen X Design * * Author(s): Ian Selby * * Licensed under the MIT License * Redistributions of files must retain the above copyright notice. * * @author Ian Selby * @copyright Copyright (c) 2009 Gen X Design * @link http://phpthumb.gxdlabs.com * @license http://www.opensource.org/licenses/mit-license.php The MIT License * @version 3.0 * @package PhpThumb * @subpackage Examples * @filesource */ $fileData = file_get_contents('test.jpg'); $thumb = new PHPThumb\GD($fileData); $thumb->crop(100, 100, 300, 200); // $imageAsString will contain the image data suitable for saving in a database. $imageAsString = $thumb->getImageAsString(); ?>

Here's the Image Data:

Note: This should be a bunch of gibberish

Here's that data as an image: