1 <?php
2
3 4 5 6 7 8 9 10
11
12 namespace Icybee\Modules\Images;
13
14 use ICanBoogie\Modules\Thumbnailer\Thumbnail;
15
16 17 18
19 class UploadOperation extends \Icybee\Modules\Files\UploadOperation
20 {
21 protected $accept = [ '.gif', '.png', '.jpg', '.jpeg' ];
22
23 protected function process()
24 {
25 $rc = parent::process();
26
27 if ($this->response['infos'])
28 {
29 $path = \ICanBoogie\strip_root($this->file->pathname);
30
31
32
33 $this->response['infos'] = '<div class="preview">'
34
35 .
36
37 new Thumbnail($path, [
38
39 'w' => 64,
40 'h' => 64,
41 'format' => 'png',
42 'background' => 'silver,white,medium',
43 'm' => 'surface'
44
45 ])
46
47 . '</div>' . $this->response['infos'];
48 }
49
50 return $rc;
51 }
52 }