示例#1
0
/*
 * Convert to global variables
 */
$size = $_GET['size'] ? $_GET['size'] : '100';
$quality = 90;
$memID = $_GET['memID'];
$crop = $_GET['crop'];
$hcrop = $_GET['hcrop'];
$sizeType = 'small';
if ($size > 17 and file_exists(BASE_PATH . "/assets/avatars/{$memID}_large.png")) {
    // If size setting is larger then 17 use the large size instead
    $sizeType = 'large';
}
$path = BASE_PATH . "/assets/avatars/{$memID}_{$sizeType}.png";
// Direct path to avatar file to use
if (!file_exists($path)) {
    $path = BASE_PATH . '/assets/themes/' . $config['settings']['style'] . '/images/avatar.png';
}
if (!file_exists($path)) {
    $path = BASE_PATH . "/assets/images/blank.png";
}
try {
    $avatar = new imagetools($path);
    $avatar->setQuality($quality);
    $avatar->setCrop($crop);
    $avatar->setHCrop($hcrop);
    $avatar->setSize($size);
    $avatar->createImage(1, '');
} catch (Exception $e) {
    die($e->getMessage());
}
/*
 * 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());
}
示例#3
0
                // Override caching
            }
        }
    }
    /* // 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());
}
示例#4
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());
}