/*
 * Convert to global variables
 */
$size = $_GET['size'] ? $_GET['size'] : '100';
$quality = $config['settings']['thumb_quality'];
$sharpen = $config['settings']['thumb_sharpen'];
$crop = $_GET['crop'];
$hcrop = $_GET['hcrop'];
$path = $incomingFolder . "/{$_GET[src]}";
// Direct path to product shot file to use
if (!file_exists($path)) {
    $path = BASE_PATH . "/assets/images/blank.png";
}
// echo $path; exit; // Testing
try {
    $contrImage = new imagetools($path);
    $contrImage->setQuality($quality);
    $contrImage->setCrop($crop);
    $contrImage->setHCrop($hcrop);
    $contrImage->setSize($size);
    $contrImage->setSharpen($sharpen);
    //$productShot->createImage(1,'');
    if ($_SESSION['debugMode'] or $config['cacheImages'] == 0) {
        $contrImage->createImage(1, '');
    } else {
        $contrImage->createImage(1, $cachePathFile);
    }
    // Cache
} catch (Exception $e) {
    die($e->getMessage());
}
示例#2
0
    /* // Testing
    		echo 'path: '.$path.'<br>';
    		echo 'quality: '.$quality.'<br>';
    		echo 'crop: '.$crop.'<br>';
    		echo 'hcrop: '.$hcrop.'<br>';
    		echo 'sharpen: '.$sharpen.'<br>';
    		echo 'watermark: '.$watermark.'<br>';
    		exit;
    		*/
    $mediaImage = new imagetools($path);
    $mediaImage->setQuality($quality);
    $mediaImage->setCrop($crop);
    $mediaImage->setDebugMode($_SESSION['debugMode'], $plstart);
    $mediaImage->setHCrop($hcrop);
    $mediaImage->setSize($size);
    $mediaImage->setSharpen($sharpen);
    $mediaImage->setWatermark($watermark);
    if ($_SESSION['debugMode'] or $config['cacheImages'] == 0 or $offSiteRequest) {
        $mediaImage->createImage(1, '');
    } else {
        $mediaImage->createImage(1, $cachePathFile);
    }
    // Cache
    //file_get_contents xxxxxxxxxx for reading cached file
} catch (Exception $e) {
    die($e->getMessage());
}
if ($db) {
    mysqli_close($db);
}
// Close any database connections
示例#3
0
if ($size > 500 and file_exists(BASE_PATH . "/assets/item_photos/{$itemType}{$itemID}_ip{$photoID}_org.jpg")) {
    // If size setting is larger then 500 use the original size instead
    $sizeType = 'org';
}
// xxxxxxxxxxxxxx check to make sure of memory limit
$path = BASE_PATH . "/assets/item_photos/{$itemType}{$itemID}_ip{$photoID}_{$sizeType}.jpg";
// Direct path to product shot file to use
if (!file_exists($path)) {
    $path = BASE_PATH . "/assets/images/blank.png";
}
if ($itemType == 'gallery' and $config['settings']['gallerythumbcrop'] and !$crop) {
    // If this is a gallery icon and thumb cropping is turned on figure out the size
    $crop = $config['settings']['gallerythumbcrop_height'];
}
try {
    $productShot = new imagetools($path);
    $productShot->setQuality($quality);
    $productShot->setCrop($crop);
    $productShot->setHCrop($hcrop);
    $productShot->setSize($size);
    $productShot->setSharpen($sharpen);
    //$productShot->createImage(1,'');
    if ($_SESSION['debugMode'] or $config['cacheImages'] == 0) {
        $productShot->createImage(1, '');
    } else {
        $productShot->createImage(1, $cachePathFile);
    }
    // Cache
} catch (Exception $e) {
    die($e->getMessage());
}