timthumb not working after site migration

229 Views Asked by At

I just move my site from xfactorapp.com and any new uploaded picture has no thumbnail. Image is on server but thumbnail is not generated.

How can I change that code to make thumbnail visible from new server?

function href_timthumb($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;
    }
}
}

which gives me:

<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">

I wish to change code to take thumbnail with param properties but from upload not from thumb.xfactorapp.com

Thanks

2

There are 2 best solutions below

0
user3612718 On

Just change $xf from true to false $xf = false.

0
Nagarathinam R On

If you changed server, May be GD Library is missing,So Install and Restart Apache then check your file permission.

// To install GD Library

sudo apt-get install php5.6-gd

// To Restart Apache2

sudo /etc/init.d/apache2 restart