This library provides an easy way to upload, manipulate and persist images.
“We don't make mistakes, just happy little accidents.” - Bob Ross
$persistenceHandler = new LocalFileSystem();
$painter = new Painter($persistenceHandler);
# From upload form ($_FILE)
$painter->loadFromFileGlobal('profile_pic');
# From file system
$painter->loadFromFileSystem('/home/bob/images/happy_trees.png');
# From Uri
$painter->loadFromUri('https://joyOfPainting.com/bob.png');
# Amazon S3
$s3Handler = new S3(new Config('credentials','key','region));
$painter = new Painter($s3Handler);
$painter->save('myFolder');
# Local
$localHandler = new LocalFileSystem();
$painter = new Painter($localHandler);
$painter->save('myFolder');
$localHandler = new LocalFileSystem();
$painter = new Painter($localHandler);
$painter->loadFromFileSystem('/home/img/tree.png');
$painter->saveFixedWidth(1200, '/home/img');
$painter->saveFixedHeight(800, '/home/img');
$painter->saveMaxWidhtHeight(1920, 1080, 'home/img');
$painter->saveThumb(200, 200, '/home/img');
$localHandler = new LocalFileSystem();
$painter = new Painter($localHandler);
$painter->loadFromFileSystem('/home/img/tree.png');
$painter->setImageCovert('bmp');
$painter->save('/home/img');
$localHandler = new LocalFileSystem();
$painter = new Painter($localHandler);
$painter->loadFromFileSystem('/home/img/tree.png');
$painter->setJpegQuality(50);
$painter->save('/home/img');