/** * * private function - do not call * */ function NewImgCreate($filename, $newxsize, $newysize, $fileout) { $type = $this->GetImgType($filename); $pathinfo = pathinfo($fileout); if (empty($pathinfo['extension'])) { $fileout .= '.' . $type; } $this->fileout = $fileout; // get some memory vmRaiseMemoryLimit('32M'); switch ($type) { case "gif": // unfortunately this function does not work on windows // via the precompiled php installation :( // it should work on all other systems however. if (function_exists("imagecreatefromgif")) { $orig_img = imagecreatefromgif($filename); break; } else { echo 'Sorry, this server doesn\'t support <b>imagecreatefromgif()</b>'; exit; break; } case "jpg": $orig_img = imagecreatefromjpeg($filename); break; case "png": $orig_img = imagecreatefrompng($filename); break; } $new_img = $this->NewImgResize($orig_img, $newxsize, $newysize, $filename); if (!empty($fileout)) { $this->NewImgSave($new_img, $fileout, $type); } else { $this->NewImgShow($new_img, $type); } ImageDestroy($new_img); ImageDestroy($orig_img); }
/* @MWM1: Load debug utility functions (currently just vmShouldDebug()) Replaces test (DEBUG == '1') and also checks if DEBUG_IP_ADDRESS is enabled. */ require_once CLASSPATH . "DebugUtil.php"; /* @MWM1: Initialize Logging */ $vmLogIdentifier = 'VirtueMart'; require_once CLASSPATH . "Log/LogInit.php"; // The abstract language class require_once CLASSPATH . "language.class.php"; /** @global vmLanguage $GLOBALS['VM_LANG'] */ $GLOBALS['VM_LANG'] = $GLOBALS['PHPSHOP_LANG'] = new vmLanguage(); // loading common language module $VM_LANG->load('common'); // Raise memory_limit to 16M when it is too low // Especially the product section needs much memory vmRaiseMemoryLimit('16M'); require_once CLASSPATH . "vmAbstractObject.class.php"; require_once CLASSPATH . "ps_cart.php"; require_once CLASSPATH . "ps_html.php"; require_once CLASSPATH . "ps_session.php"; require_once CLASSPATH . "ps_function.php"; require_once CLASSPATH . "ps_module.php"; require_once CLASSPATH . "ps_perm.php"; require_once CLASSPATH . "ps_shopper_group.php"; require_once CLASSPATH . "ps_vendor.php"; require_once CLASSPATH . 'template.class.php'; require_once CLASSPATH . "htmlTools.class.php"; require_once CLASSPATH . "phpInputFilter/class.inputfilter.php"; // Instantiate the DB class $db = new ps_DB(); // Instantiate the permission class