Файл: loads/inc/icon48/png.php
Строк: 31
<?php
if (is_file(H . "sys/loads/screens/48/$size.$name.$ras")) {
if (function_exists('iconv')) {
echo "<img src='/sys/loads/screens/48/" . iconv('windows-1251', 'utf-8', "$size.$name.$ras") . "' style='width: 60px; heigth: 60px;' alt='scr...' /><br />n";
} else {
echo "<img src='/sys/loads/screens/48/$size.$name.$ras' style='width: 60px; heigth: 60px;' alt='scr...' /><br />n";
}
} elseif (function_exists('imagecreatefrompng')) {
$imgc = imagecreatefrompng($dir_loads . '/' . $dirlist[$i]);
$img_x = imagesx($imgc);
$img_y = imagesy($imgc);
if ($img_x == $img_y) {
$dstW = 48; // ширина
$dstH = 48; // высота
} elseif ($img_x > $img_y) {
$prop = $img_x / $img_y;
$dstW = 48;
$dstH = ceil($dstW / $prop);
} else {
$prop = $img_y / $img_x;
$dstH = 48;
$dstW = ceil($dstH / $prop);
}
$screen = imagecreate($dstW, $dstH);
imagecopyresampled($screen, $imgc, 0, 0, 0, 0, $dstW, $dstH, $img_x, $img_y);
imagedestroy($imgc);
imagepng($screen, H . "sys/loads/screens/48/$size.$name.$ras");
imagedestroy($screen);
echo "<img src='/sys/loads/screens/48/$size.$name.$ras' style='width: 60px; heigth: 60px;' alt='scr...' />n";
} else {
echo "<img src='/sys/loads/screens/48/$size.$name.$ras' style='width: 60px; heigth: 60px;' alt='file' />n";
}