<?php require "imagefilter.inc.php"; if (isset($_GET['hash'])) { $imagehash = $_GET['hash']; $imagetype = $_GET['type']; $filtertype = $_GET['filter']; $intensity = $_GET['bintensity']; $imageObject = new imageFilters($imagehash, $imagetype); switch ($filtertype) { case "blackwhite": $imageObject->blackwhite(); break; case "bright": $imageObject->brightness($intensity); break; case "smooth": $imageObject->smooth(); break; case "reset": $imageObject->reset(); break; default: echo ""; } $imageObject->displayImage(); }
} return $mimetype; } $validImageFormat = array('jpg', 'jpeg', 'png'); if (is_array($_FILES)) { if (is_uploaded_file($_FILES['userImage']['tmp_name'])) { $sourcePath = $_FILES['userImage']['tmp_name']; $targetPath = "images/" . $_FILES['userImage']['name']; if (move_uploaded_file($sourcePath, $targetPath)) { $ext = strtolower(pathinfo($targetPath, PATHINFO_EXTENSION)); $hash = hash_file('md5', $targetPath); $fileHash = $hash . "." . $ext; $tempName = $hash . "_temp." . $ext; $newFileName = "images/" . $fileHash; rename($targetPath, $newFileName); $imageObject = new imageFilters($hash, $ext); list($width, $height) = $imageObject->displayWidthHeight(); if (in_array(strtolower($ext), $validImageFormat)) { ?> <img src="<?php echo $newFileName; ?> " id="<?php echo $fileHash; ?> " class='dropped-image' height="<?php echo $height; ?> " width="<?php echo $width;