d8c1a2e0
Yarik
Big commit artbox
|
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
use yii\image\drivers\Image;
//use common\components\artboximage\drivers\Image;
class ArtboxImage extends Component {
public $driver;
public $presets = [];
public $rootPath;
public $rootUrl;
public $extensions = [
'jpg' => 'jpeg',
'jpeg' => 'jpeg',
'png' => 'png',
'gif' => 'gif',
'bmp' => 'bmp',
];
|
d8c1a2e0
Yarik
Big commit artbox
|
28
29
30
31
32
33
|
public function load($file = null, $driver = null) {
if(empty($file) || !realpath($file)) {
throw new ErrorException('File name can not be empty and exists');
}
return Image::factory($file, $driver ? $driver : $this->driver);
}
|