if ($this->theme->parametres->favicon != '') {
$pngFile = $this->themeRoot . '/' . $this->theme->parametres->favicon;
+ $icoFile = $this->themeRoot . '/favicon.ico';
+ if (!file_exists($icoFile) || filemtime($icoFile) < filemtime($pngFile) || filemtime(__FILE__) > filemtime($icoFile)) {
+ $tmp = CubeIT_Files::tempnam() . '.png';
+ $convert = "convert $pngFile -resize 64x64^ -gravity center $tmp";
+ `$convert`;
+
+ $icotool = new cubeCommandLine('icotool');
+ $icotool->setArg('c');
+ $icotool->setArg('o', $icoFile);
+ $icotool->setArg(null, $tmp);
+ $icotool->execute();
+
+ unlink($tmp);
+ }
+
+ $this->vdir->copy($icoFile, 'data/favicon.ico');
$this->vdir->copy($pngFile, 'data/favicon.png');
+
$datapng = 'data:image/png;base64,' . base64_encode(file_get_contents($pngFile));
$favicon .= '<link rel="icon" type="image/png" href="' . $datapng . '" />' . "\n\t";