}
$icotool->execute();
- $png2icns->execute();
rename($tmp . '/ico-16.png', $tmp . '/favicon.png');
}
public static function pngToIcns($file, $res) {
+ if(!file_exists($file)){
+ return;
+ }
$icns = array(128, 256, 512);
$png2icns = new cubeCommandLine('png2icns');
foreach ($icns as $s) {
$r = CubeIT_Files::tempnam() . '.png';
- $tmp[]=$r;
+ $tmp[] = $r;
$it = new cubeImageTools();
$it->loadImage($file);
$it->resize($s, $s, 'crop', true, 'C', 'M', 'transparent');
}
$png2icns->execute();
-
foreach ($tmp as $item) {
unlink($tmp);
}