<?php

use Intellex\Manicure\Engine;
use Intellex\Manicure\Source\LocalSource;

require 'bootstrap.php';

// Get random image
$images = glob('images/*.jpg');
$source = new LocalSource($images[array_rand($images)]);
$source = new \Intellex\Manicure\Source\UrlSource('http://gs1gln.rs/uploads/GLN/Image/09-12-2014/FIST%20logo.jpg');
$engine = new Engine($source);

// Apply
$engine->quickApply([
	[ 'Resize\Pad', 300, 300 ],
	[ 'Resize\Scale', 500, 500 ],
	[ 'Resize\Center', 500, 500 ],
	// [ 'Overlay', 200, 200, 200, 100 ],
]);

// Output
header('Content-Type: image/png');
echo imagepng($engine->getResult()->getData());
