You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
590 B
29 lines
590 B
5 years ago
|
<?php
|
||
|
/**
|
||
|
* Created by IntelliJ IDEA.
|
||
|
* User: luwei
|
||
|
* Date: 2017/12/20
|
||
|
* Time: 14:06
|
||
|
*/
|
||
|
|
||
|
namespace app\extensions;
|
||
|
|
||
|
|
||
|
class GrafikaHelper
|
||
|
{
|
||
|
/**
|
||
|
* 获取支持的图片处理库
|
||
|
* @return array
|
||
|
*/
|
||
|
public static function getSupportEditorLib()
|
||
|
{
|
||
|
switch(true){
|
||
|
case function_exists('gd_info'):
|
||
|
return ['Gd'];
|
||
|
case class_exists('\Imagick') && method_exists((new \Imagick()), 'setImageOpacity'):
|
||
|
return ['Imagick'];
|
||
|
default:
|
||
|
return ['Gd'];
|
||
|
}
|
||
|
}
|
||
|
}
|