Файл: modules/obmen/inc/file/jpg.php
Строк: 40
<?php
/* DCMS S (Special)
 * Версия файла 0.0.1
 * Дата последнего редактирования 14.11.2015
 * Модифицировал densnet
 */
if (!is_file(LF_PATH . '.JPG') && $imgc = @imagecreatefromjpeg(LF_PATH)) {
    $img_x = imagesx($imgc);
    $img_y = imagesy($imgc);
    $x_ratio = SCR_WIDTH / $img_x;
    if ($img_x <= SCR_WIDTH) {
        $dstW = $img_x;
        $dstH = $img_y;
    } else {
        $dstH = ceil($x_ratio * $img_y);
        $dstW = SCR_WIDTH;
    }
    $screen = imagecreatetruecolor($dstW, $dstH);
    imagecopyresampled($screen, $imgc, 0, 0, 0, 0, $dstW, $dstH, $img_x, $img_y);
    imagedestroy($imgc);
//$screen=img_copyright($screen); // наложение копирайта
    imagejpeg($screen, LF_PATH . '.JPG', 95);
    imagedestroy($screen);
}
echo "<div class='list-group-item'><center>$file_id[name]</center></div>";
include 'inc/screens.php';
echo "<div class='list-group-item'>";
if ($file_id['opis']) {
    echo "<font color='green'>";
    echo toOutput($file_id['opis']);
    echo "</font><br />n";
}
$ank = get_user($file_id['id_user']);
echo "<div class = 'hr'></div><small>";
if (function_exists('getimagesize')) {
    $img_size = getimagesize($file);
    echo "Разрешение изображения: <font color = 'green'>$img_size[0]x$img_size[1] пикс.</font><br />n";
    echo "<script type='text/javascript'> document.write('Ваше разрешение: <b>'+screen.width+'×'+screen.height+'</b>'); </script><br />";
}
echo "Добавлен: <font color = 'green'>" . date::times($file_id['time']) . " (<a href='/info.php?id=$ank[id]'>$ank[nick]</a>)</font><br />n";
echo "Размер: <font color = 'green'>" . size_file($size) . "</font>";
echo "</small></div>";