Version 2

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.

Leave a Reply

  • Categories

  • Client testimonials

    "There is nothing that Intricate Web can't do. I came to Intricate with the idea of creating a very simple, blog-based site. By the time the site was finished, we had created an interactive, dynamic website that allowed us to spread word about our business quickly and effectively. And, Intricate completed the site on time and for less than a quarter of the cost of other web companies."
    Andrew Hunt | Scholars for Students
    <?php

    echo “Are you a Web Designer”;
    echo “Intricate Web can provide”;
    echo “White label Development”;
    echo “for your design firm.”;
    print “Outsource locally”;
    // comment - it’s our little secret.

    ?>
    © 2010 Intricate Web LLC
    Call us today! 401.709.4469