-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestthumbnail.php
34 lines (27 loc) · 931 Bytes
/
testthumbnail.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
<?php
// include thumbnail code
include "createthumbnail.php";
// set source (create this folder and put this image there)
$src = "images/dog.jpg";
// set destination (create this folder)
$dest = "thumbnails/dog.jpg";
// create a thumbnail of an image on the server
if (!file_exists($dest)) {
createThumbnail($src, $dest, 100, 100);
}
// show original image
echo "<h1>The Original Image</h1>";
if (file_exists($src)) {
echo "<body bgcolor='yellow'> <img src='" . $src . "' alt='horse'><br>";
} else {
echo $src . " doesn't exist.<br>";
} // else
// show thumbnail (refresh the thumbnail folder in WinSCP after
// running this script, and a new image should appear)
echo "<h1>The Thumbnail</h1>";
if (file_exists($dest)) {
echo "<img src='" . $dest . "' alt='horse'>";
} else {
echo $dest . " did not get created. Check permissions on the folder.<br>";
} // else
?>