-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdemo.php
More file actions
27 lines (21 loc) · 727 Bytes
/
Copy pathdemo.php
File metadata and controls
27 lines (21 loc) · 727 Bytes
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
26
27
<?php
/**
* Simple example to show how the library is used
*
* Generates the image and sends it back to the browser
*/
require_once 'vendor/autoload.php';
use splitbrain\RingIcon\RingIcon;
use splitbrain\RingIcon\RingIconSVG;
// define size and number of rings
if (empty($_GET['svg'])) {
$ringicon = new RingIcon(128, 3);
} else {
$ringicon = new RingIconSVG(128, 3);
}
// decide if monochrome image is wanted
$ringicon->setMono(!empty($_GET['mono']));
// image output directly to browser (seed optionally from parameter)
$ringicon->createImage(isset($_GET['seed']) ? $_GET['seed'] : '');
// example to save an image based on an email address:
// $ringicon->createImage('mail@example.com', '/tmp/avatar.png');