Disable image GD2 resize in Cubecart for categories or any other section
Today I needed to disable the image resize on uploads in cubecart. I wanted to keep it for products but I wanted to block the resize from categories and a custom slideshow module I created. Below are the steps I took: ( be sure to back-up your files before you start )
1. in admin\includes\rte\editor\filemanager\connectors\php\commands.php : line 258
Replace:
if (($size[0] > $config['gdmaxImgSize']) || ($size[1] > $config['gdmaxImgSize'])) {
@chmod($sFilePath, 0777);
$img = new gd($sFilePath);
if (isset($_POST['no_resize'])) {
$img->size_auto($size[0]);
} else {
$img->size_auto($config['gdmaxImgSize']);
}
$img->save($sFilePath);
}
With:
if (($size[0] > $config['gdmaxImgSize']) || ($size[1] > $config['gdmaxImgSize'])) {
if($_GET["noresize"] == '1'){
@chmod($sFilePath, 0777);
$img = new gd($sFilePath);
if (isset($_POST['no_resize'])) {
$img->size_auto($size[0]);
} else {
$img->size_auto($config['gdmaxImgSize']);
}
$img->save($sFilePath);
}
}
Notice I added a check for noresize.
2. If you want to block image resize on categories for example this is all you have to do.
go to: admin/sources/categories/index.inc.php : line 366
Replace:
browser.html?Type=uploads
With:
browser.html?Type=uploads&noresize=1
Notice I added a check for &noresize=1.
—
That’s it. I hope this saved you some time.



