forked from claviska/SimpleImage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
25 lines (21 loc) · 860 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
require '../src/claviska/SimpleImage.php';
// Ignore notices
error_reporting(E_ALL & ~E_NOTICE);
try {
// Create a new SimpleImage object
$image = new \claviska\SimpleImage();
// Manipulate it
$image
->fromFile('parrot.jpg') // load parrot.jpg
->autoOrient() // adjust orientation based on exif data
->bestFit(300, 600) // proportinoally resize to fit inside a 250x400 box
->flip('x') // flip horizontally
->colorize('DarkGreen') // tint dark green
->border('black', 5) // add a 5 pixel black border
->overlay('flag.png', 'bottom right') // add a watermark image
->toScreen(); // output to the screen
} catch(Exception $err) {
// Handle errors
echo $err->getMessage();
}