if (!isset($_POST['round']) || $_POST['round'] == 0) {
$round = $upload;
} else {
- $w = $dim[0];
- $ra = round($w * ($_POST['round'] / 100));
$round = $tmp . '/round.png';
- $im = new cubeCommandLine('convert');
- $im->setPath(CONVERTER_PATH);
- $im->setArg(null, $upload);
- $c = '\( +clone -alpha extract ';
- $c.='-draw \'fill black polygon 0,0 0,' . $ra . ' ' . $ra . ',0 fill white circle ' . $ra . ',' . $ra . ' ' . $ra . ',0\' ';
- $c.='\( +clone -flip \) -compose Multiply -composite ';
- $c.='\( +clone -flop \) -compose Multiply -composite ';
- $c.='\) -alpha off -compose CopyOpacity -composite ';
- $im->setManualArg($c);
- $im->setArg(null, $round);
- $im->execute();
+
+ $conv = new CubeIT_CommandLine_Imagemagick_Round();
+ $conv->setSrc($upload);
+ $conv->setDest($round);
+ $conv->setRadius($_POST['round']);
+ $conv->execute();
}
$png2icns = new cubeCommandLine('png2icns');