"; // load image and get image size $img = imagecreatefromjpeg( "{$pathToImages}" ); $width = imagesx( $img ); $height = imagesy( $img ); // calculate thumbnail size $new_width = $thumbWidth; $new_height = floor( $height * ( $thumbWidth / $width ) ); // create a new temporary image $tmp_img = imagecreatetruecolor( $new_width, $new_height ); // copy and resize old image into new image imagecopyresized( $tmp_img, $img, 0, 0, 0, 0, $new_width, $new_height, $width, $height ); // save thumbnail into a file imagejpeg( $tmp_img, "{$pathToThumbs}", 80); } // Setup // Default values if no GET is supplied $image1_file_jpg = "1291834647_766127-000001__11-DEMOSAIC.jpeg"; $image2_file_jpg = "1291834647_766127-000001__11-COMBO.jpeg"; // Define Dropdown Menu Image Sets here: $i = 0; $ImageSet[$i++]="?image1=1291834647_766127-000001__11-DEMOSAIC.jpeg&image2=1291834647_766127-000001__11-COMBO.jpeg"; $ImageSet[$i++]="?image1=1291834647_766127-000001__12-DEMOSAIC.jpeg&image2=1291834647_766127-000001__12-COMBO.jpeg"; $ImageSet[$i++]="?image1=1291834647_766127-000001__13-DEMOSAIC.jpeg&image2=1291834647_766127-000001__13-COMBO.jpeg"; $ImageSet[$i++]="?image1=1291834647_766127-000001__21-DEMOSAIC.jpeg&image2=1291834647_766127-000001__21-COMBO.jpeg"; $ImageSet[$i++]="?image1=1291834647_766127-000001__22-DEMOSAIC.jpeg&image2=1291834647_766127-000001__22-COMBO.jpeg"; $ImageSet[$i++]="?image1=1291834647_766127-000001__23-DEMOSAIC.jpeg&image2=1291834647_766127-000001__23-COMBO.jpeg"; $ImageSet[$i++]="?image1=1291834647_766127-000001__32-DEMOSAIC.jpeg&image2=1291834647_766127-000001__32-COMBO.jpeg"; $ImageSet[$i++]="?image1=1291834647_766127-000001__33-DEMOSAIC.jpeg&image2=1291834647_766127-000001__33-COMBO.jpeg"; // Load from GET if (isset($_GET['image1'])) $image1_file_jpg = $_GET['image1']; if (isset($_GET['image2'])) $image2_file_jpg = $_GET['image2']; // Init $image1_file = substr ($image1_file_jpg, 0, strrpos($image1_file_jpg, ".")); // remove extension $image1_file_thumb_jpg = $image1_file."_thumb.jpg"; $image2_file = substr ($image2_file_jpg, 0, strrpos($image2_file_jpg, ".")); // remove extension $image2_file_thumb_jpg = $image2_file."_thumb.jpg"; // generate thumbnails $path = getcwd(); if (strstr($image1_file_jpg, "http://")) { // if we are using remote images use md5 hashes as thumbnail names. $image1_file_thumb_jpg = md5($image1_file_thumb_jpg)."_thumb.jpg"; if (!file_exists($path."/".$image1_file_thumb_jpg)) createThumb($image1_file_jpg, $path."/".$image1_file_thumb_jpg, 200); } else { if (!file_exists($path."/".$image1_file_thumb_jpg)) createThumb($path."/".$image1_file_jpg, $path."/".$image1_file_thumb_jpg, 200); } if (strstr($image2_file_jpg, "http://")) { $image2_file_thumb_jpg = md5($image2_file_thumb_jpg)."_thumb.jpg"; if (!file_exists($path."/".$image2_file_thumb_jpg)) createThumb($image2_file_jpg, $path."/".$image2_file_thumb_jpg, 200); } else { if (!file_exists($path."/".$image2_file_thumb_jpg)) createThumb($path."/".$image2_file_jpg, $path."/".$image2_file_thumb_jpg, 200); } ?> Elphel Image Viewer
Raw Image'."\n"; echo ' Enhanced Image'."\n"; echo ''."\n"; echo "double clicking the image also toggles"; ?>
';?>