Exemple #1
0
    $aspectRatio = 1 / $aspectRatio;
}
is_null($aspectRatio) or is_numeric($aspectRatio) or errorPage('Aspect ratio out of range', 404);
verbose("aspect ratio = {$aspectRatio}");
$cropToFit = getDefined(array('crop-to-fit', 'cf'), true, false);
verbose("crop to fit = {$cropToFit}");
$backgroundColor = getConfig('background_color', null);
if ($backgroundColor) {
    $img->setDefaultBackgroundColor($backgroundColor);
    verbose("Using default background_color = {$backgroundColor}");
}
$bgColor = get(array('bgColor', 'bg-color', 'bgc'), null);
verbose("bgColor = {$bgColor}");
$resizeStrategy = getDefined(array('no-resample'), true, false);
if ($resizeStrategy) {
    $img->setCopyResizeStrategy($img::RESIZE);
    verbose("Setting = Resize instead of resample");
}
$fillToFit = get(array('fill-to-fit', 'ff'), null);
verbose("fill-to-fit = {$fillToFit}");
if ($fillToFit !== null) {
    if (!empty($fillToFit)) {
        $bgColor = $fillToFit;
        verbose("fillToFit changed bgColor to = {$bgColor}");
    }
    $fillToFit = true;
    verbose("fill-to-fit (fixed) = {$fillToFit}");
}
$keepRatio = getDefined(array('no-ratio', 'nr', 'stretch'), false, true);
verbose("keep ratio = {$keepRatio}");
$crop = get(array('crop', 'c'));