【发布时间】:2018-09-29 04:28:17
【问题描述】:
我在 GitHub 上找到了一个用 php 提取图像颜色的类。首先我确实创建了一个 php 文件并将这些行添加到文件中:
require_once 'ColorThief.php';
$sourceImage = '1.jpg';
use ColorThief\ColorThief;
$palette = ColorThief::getPalette($sourceImage, 8);
但问题是我收到此错误消息,但我不知道如何解决它:
Fatal error: Class 'ColorThief\Image\ImageLoader' not found in C:\UwAmp\www\ColorThief\ColorThief.php on line 182
Call Stack
# Time Memory Function Location
1 0.0002 133416 {main}( ) ...\show.php:0
2 0.0038 198232 ColorThief\ColorThief::getPalette( ) ...\show.php:9
3 0.0038 198440 ColorThief\ColorThief::loadImage( ) ...\ColorThief.php:140
你们知道我如何使用这个类吗? GitHub页面:
【问题讨论】:
-
您是否使用 composer 安装了 ColorThief 而没有出现我们的错误?
-
没有作曲家