diff --git a/setup/tools/clisetup/build.func.php b/setup/tools/clisetup/build.func.php index 7cdd11f0..8300778b 100644 --- a/setup/tools/clisetup/build.func.php +++ b/setup/tools/clisetup/build.func.php @@ -113,7 +113,7 @@ function build() $allOk = false; CLISetup::log(' - subscript \''.$file.'\' returned '.($ok ? 'sucessfully' : 'with errors'), $ok ? CLISetup::LOG_OK : CLISetup::LOG_ERROR); - set_time_limit(SqlGen::$defaultExecTime); // reset to default for the next script + set_time_limit(FileGen::$defaultExecTime); // reset to default for the next script } // end diff --git a/setup/tools/filegen/complexImg.func.php b/setup/tools/filegen/complexImg.func.php index 068b94a5..475580d0 100644 --- a/setup/tools/filegen/complexImg.func.php +++ b/setup/tools/filegen/complexImg.func.php @@ -82,7 +82,10 @@ if (!CLI) $file = $path.'.png'; if (CLISetup::fileExists($file)) + { + CLISetup::log('manually converted png file present for '.$path.'.', CLISetup::LOG_WARN); $result = imagecreatefrompng($file); + } if (!$result) { diff --git a/setup/tools/filegen/simpleImg.func.php b/setup/tools/filegen/simpleImg.func.php index 924eaa13..64331490 100644 --- a/setup/tools/filegen/simpleImg.func.php +++ b/setup/tools/filegen/simpleImg.func.php @@ -15,6 +15,32 @@ if (!CLI) function simpleImg() { + // prefer manually converted PNG files (as the imagecreatefromblp-script has issues with some formats) + // see: https://github.com/Kanma/BLPConverter + $loadImageFile = function($path) + { + $result = null; + + if (in_array(substr($path, -4, 4), ['.png', '.blp'])) + $path = substr($path, 0, strlen($path) - 4); + + $file = $path.'.png'; + if (CLISetup::fileExists($file)) + { + CLISetup::log('manually converted png file present for '.$path.'.', CLISetup::LOG_WARN); + $result = imagecreatefrompng($file); + } + + if (!$result) + { + $file = $path.'.blp'; + if (CLISetup::fileExists($file)) + $result = imagecreatefromblp($file); + } + + return $result; + }; + if (isset(FileGen::$cliOpts['help'])) { echo "\n"; @@ -131,8 +157,11 @@ if (!CLI) { $ok = false; $dest = imagecreatetruecolor($destDims['w'], $destDims['h']); + imagesavealpha($dest, true); - imagealphablending($dest, false); + if ($ext == 'png') + imagealphablending($dest, false); + imagecopyresampled($dest, $src, $destDims['x'], $destDims['x'], $srcDims['x'], $srcDims['y'], $destDims['w'], $destDims['h'], $srcDims['w'], $srcDims['h']); switch ($ext) @@ -320,7 +349,7 @@ if (!CLI) } if (!$src) - $src = imagecreatefromblp($f); + $src = $loadImageFile($f); if (!$src) // error should be created by imagecreatefromblp continue; @@ -383,7 +412,7 @@ if (!CLI) } if (!$src) - $src = imagecreatefromblp($f); + $src = $loadImageFile($f); if (!$src) // error should be created by imagecreatefromblp continue; diff --git a/template/pages/home.tpl.php b/template/pages/home.tpl.php index 8f7e288c..201b829b 100644 --- a/template/pages/home.tpl.php +++ b/template/pages/home.tpl.php @@ -56,7 +56,7 @@ | - + brick('pageTemplate'); ?>