-
Notifications
You must be signed in to change notification settings - Fork 1
/
createthumbs.php
75 lines (49 loc) · 1.44 KB
/
createthumbs.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
<?php
include 'includes/checklogin.php';
if (
isset($_GET['pic']) AND
class_exists("Imagick")
)
{
if (!extension_loaded('imagick')) echo 'imagick not installed';
$picToResize=$_GET['pic'];
if (file_exists('capture/usb/preview-'.$picToResize))
{
//DO NOTHING
$previewExists=true;
}
else
{
$thumb = new Imagick('capture/usb/'.$picToResize);
$thumb->resizeImage(162,122,Imagick::FILTER_POINT,1); //162x122
$thumb->writeImage('capture/usb/preview-'.$picToResize);
$thumb->destroy();
}
if (file_exists('capture/usb/fbi-'.$picToResize))
{
//DO NOTHING
$fbiExists=true;
}
else
{
$thumb = new Imagick('capture/usb/'.$picToResize);
$thumb->resizeImage(640,480,Imagick::FILTER_POINT,1); //640x480
$thumb->writeImage('capture/usb/fbi-'.$picToResize);
$thumb->destroy();
}
if (!$fbiExists OR !$previewExists )
{
//"Preview erfolgreich erstellt"
echo "Preview erfolgreich erstellt";
}
else
{
//"Die Previews existieren schon !"
echo "Die Previews existieren schon !";
}
}
else
{
header( 'Location: listimages.php' );
}
?>