C:\xampp\htdocs\kptv2\admin\php\inc\thumbnail_gen.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?php
function createThumb($filename,$uid$extension$location_$x =150$y=150$proportain 1)
{
    
$location $location_ .$uid.'.'.$extension;
    if (!
$image=getimagesize($filename)) {
        return 
FALSE//return false if there is no image to create from or it is not a image
    
} else {
    if (
$image['2'] == '1') {
        
$im imagecreatefromgif ($filename);
    } else if (
$image['2'] == '2') {
        
$im imagecreatefromjpeg ($filename); 
    } else {
        return 
FALSE// return false if filetype is not of gif or jpeg
    
}
    
$x_ $x;
    
$y_ $y;
    if (
$proportain == 1) {
        if (
$image[0]<$image[1]) {    
            
$x_ $y * ($image[0]/$image[1]);
        } else {
            
$y_ $x / ($image[0]/$image[1]); 
        }
    }
    
    
$dy = ($y $y_)/2;
    
    
$newim imagecreatetruecolor($x$y);
    
$color imagecolorallocate($newim235236236);
    
imagefilledrectangle ($newim00$x$y$color);
    
ImageCopyResized($newim$im0$dy00$x_$y_$image[0], $image[1]);
    
imagejpeg($newim$location);
    
imagedestroy ($im);
    
imagedestroy ($newim);
    return 
TRUE;
    }
}

function 
RectangleEf($imageName$path) {
    if (!
$image=getimagesize($imageName)) {
        return 
FALSE
    } else {
        if (
$image['2'] == '1')
            
$im imagecreatefromgif ($imageName);
        else if (
$image['2'] == '2')
            
$im imagecreatefromjpeg ($imageName); 
        else
            return 
FALSE// return false if filetype is not of gif or jpeg
        
        
$color imagecolorallocate($im209210212);
        
// left        
//        $color = imagecolorallocate($im, 0, 0, 212);
        
imagefilledrectangle ($im004010$color);
        
imagefilledrectangle ($im0010230$color);
        
imagefilledrectangle ($im022040230$color);
        
        
// right
        
imagefilledrectangle ($im190023010$color);
        
imagefilledrectangle ($im2200230230$color);
        
imagefilledrectangle ($im190220230230$color);
        
        
imagejpeg($im$path99);
    
//    print_r("ASDASD");
        
imagedestroy($im);
    }
}

function 
RectangleEf2($imageName$path) {
    if (!
$image=getimagesize($imageName)) {
        return 
FALSE
    } else {
        if (
$image['2'] == '1')
            
$im imagecreatefromgif ($imageName);
        else if (
$image['2'] == '2')
            
$im imagecreatefromjpeg ($imageName); 
        else
            return 
FALSE// return false if filetype is not of gif or jpeg
        
        
$color imagecolorallocate($im209210212);
        
imagefilledrectangle ($im00105$color);
        
imagefilledrectangle ($im00547$color);
        
imagefilledrectangle ($im0421047$color);
        
        
// right
        
imagefilledrectangle ($im640745$color);
        
imagefilledrectangle ($im6907447$color);
        
imagefilledrectangle ($im64427447$color);
        
        
imagejpeg($im$path99);
    
//    print_r("ASDASD");
        
imagedestroy($im);
    }
}
?>
x

Windows NT KPTV 6.2 build 9200 (Windows Server 2012 Datacenter Edition) i586