Вход Регистрация
Файл: user/files/file/png.php
Строк: 28
<?php

if (is_file(H . "sys/files/screens/$file_id[id].gif")) {
    echo 
"<div class = 'foot'>";
    echo 
"<img src='/sys/files/screens/$file_id[id].gif' alt='scr...' />";
    echo 
"</div>";
} elseif (
function_exists('imagecreatefromstring')) {

    
$imgc = imagecreatefromstring(file_get_contents($file));
    
$img_x = imagesx($imgc);
    
$img_y = imagesy($imgc);
    if (
$img_x == $img_y) {
        
$dstW = 128; // ширина
        
$dstH = 128; // высота 
    
} elseif ($img_x > $img_y) {
        
$prop = $img_x / $img_y;
        
$dstW = 128;
        
$dstH = ceil($dstW / $prop);
    } else {
        
$prop = $img_y / $img_x;
        
$dstH = 128;
        
$dstW = ceil($dstH / $prop);
    }

    
$screen = imagecreatetruecolor($dstW, $dstH);
    
$black = imagecolorallocate($screen, 0, 0, 0);
    
imagecolortransparent($screen, $black);
    
imagecopyresampled($screen, $imgc, 0, 0, 0, 0, $dstW, $dstH, $img_x, $img_y);
    
imagedestroy($imgc);
    
$screen = img_copyright($screen); // наложение копирайта
    
imagepng($screen, H . "sys/files/screens/$file_id[id].$ras");
    
imagedestroy($screen);
    echo 
"<div class = 'foot'>";
    echo 
"<img src='/sys/files/screens/$file_id[id].$ras' alt='Скрин...' />";
    echo 
"</div>";
}
if (
$file_id['opis'] != NULL) {
    echo 
"<div class = 'foot'>";
    echo 
trim(br(links($file_id['opis'])));
    echo 
"</div>";
}

if (
function_exists('getimagesize')) {
    
$img_size = getimagesize($file);
    echo 
"<div class = 'foot'>";
    echo 
"<img src = '/style/icons/layer-resize-actual.png' /> $img_size[0]*$img_size[1] пикс.<br />n";
    echo 
"</div>";
}
Онлайн: 2
Реклама