小编Sim*_*duc的帖子

Laravel 5 imagepng 不起作用

我正在尝试创建一个脚本来获取图像的某个部分,但是当我使用 imagepng 时,它返回给我: 在此处输入图片说明

这是我的代码

$name = $path;

header("Content-type: image/png");

if (strpos($name, '..') !== false) {
   exit(); // name in path with '..' in it would allow for directory 
   traversal.
}

$size = $face_size > 0 ? $face_size : 100;

//Grab the skin
$src = imagecreatefrompng("./skins/" . $name . ".png");
//If no path was given or no image can be found, then create from default
if (!$src) {
    $src = imagecreatefrompng("./skins/default.png");
}
//Start creating the image
list($w, $h) = getimagesize("./skins/" . …
Run Code Online (Sandbox Code Playgroud)

php laravel laravel-5

3
推荐指数
1
解决办法
1486
查看次数

标签 统计

laravel ×1

laravel-5 ×1

php ×1