mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
is it 2015 already..?
setup/simpleImg: - also prefer PNG over BLP when generating icons - do not use alpha on icons (see icon: fishingextravaganza)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
<a href="?aboutus"><?php echo Lang::main('aboutUs'); ?></a>|
|
||||
<a href="#" id="footer-links-language"><?php echo Lang::main('language'); ?></a>
|
||||
</div>
|
||||
<div class="footer-copy">ツ 2014 Aowow</div>
|
||||
<div class="footer-copy">ツ 2015 Aowow</div>
|
||||
</div>
|
||||
|
||||
<?php $this->brick('pageTemplate'); ?>
|
||||
|
||||
Reference in New Issue
Block a user