0

我只是从 xfactorapp.com 移动我的网站,任何新上传的图片都没有缩略图。图像在服务器上,但未生成缩略图。

如何更改该代码以使缩略图从新服务器可见?

function href_t`imthumb($file, $set = null, $xf = true) {
if (!$set || !$xf) {
    $timthumb = webpath_assets('/timthumb.php');
    $href = $timthumb . '?src=' . $file;
    if (xcount($set) > 0) {
        foreach ($set as $k => $v) {
            $href .= '&' . $k . '=' . $v;
        }
    }
    return $href;
} else {
    $param['w'] = 150;
    $param['h'] = 150;
    $param['zc'] = 0;
    $param['q'] = 90;
    if (DEV) {
        $app = DEV_PREFIX . APP_VERSION;
    } else {
        $app = LIVE_PREFIX . APP_VERSION;
    }
    if (xcount($set) > 0) {
        foreach ($set as $k => $v) {
            $param[$k] = $v;
        }
        $file = '/' . $app . $file;
        $protocol = 'http';
        if (isSSL()) {
            $protocol = 'https';
        }
return $protocol . '://thumb.xfactorapp.com/tt/' . implode('/', $param) . $file;
    }
}
}

给我:

<img class="img-responsive" alt="building" src="http://thumb.xfactorapp.com/tt/263/147/2/90/v3/uploads/_lifttec/cms/58529051881f8f0d87ab1401/5947fffeac28b_200-ATJ-Platforma-autoridicatoare-articulata.jpg">

我希望更改代码以获取具有 parnam 属性的缩略图,但不是从 thumb.xfactorapp.com 上传

谢谢

4

2 回答 2

0

只需将 $xf 从 true 更改为 false $xf = false。

于 2017-12-05T13:08:37.363 回答
0

如果您更改了服务器,可能是缺少 GD 库,因此请安装并重新启动 Apache,然后检查您的文件权限

// 安装 GD 库

sudo apt-get install php5.6-gd

// 重启 Apache2

须藤 /etc/init.d/apache2 重启

于 2018-05-11T19:50:53.363 回答