-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathImageTilerConfig.php
52 lines (45 loc) · 1.69 KB
/
ImageTilerConfig.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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php namespace ProcessWire;
class ImageTilerConfig extends ModuleConfig {
public function getDefaults() {
return array(
"format" => "jpg",
"quality" => "80",
"tileSize" => 256,
"fillColor" => "#FFFFF"
);
}
//tileImage($sourceImagePath, $destination, $this->format, $this->quality, $this->tileSize, $this->fillColor);
public function getInputfields() {
$inputfields = parent::getInputfields();
$f = $this->modules->get("InputfieldText");
$f->attr('name', 'tileSize');
$f->attr('size', 10);
$f->label = __('Tile Size');
$f->description = __('The hight and width of a single tile');
$f->columnWidth = 20;
$inputfields->add($f);
$f = $this->modules->get("InputfieldText");
$f->attr('name', 'fillColor');
$f->attr('size', 10);
$f->label = __('Fill Color');
$f->description = __('Color to fill the free space if tile is not square');
$f->columnWidth = 20;
$inputfields->add($f);
$f = $this->modules->get("InputfieldSelect");
$f->attr('name', 'format');
$f->label = __('Image Format');
$f->description = __('The image format for the tiles. Transparancy is enabled if PNG is chosen');
$f->addOption('jpg');
$f->addOption('png');
$f->columnWidth = 20;
$inputfields->add($f);
$f = $this->modules->get("InputfieldText");
$f->attr('name', 'quality');
$f->attr('size', 10);
$f->label = __('Quality');
$f->description = __('Possible quality values for the jpg format are 0 (worst quality) - 100 (best quality). For the png format possible values are 0 (low compression) - 9 (high compresseion)');
$f->columnWidth = 40;
$inputfields->add($f);
return $inputfields;
}
}