This is my plan:
Upon clicking the submit button. The image must appear to be sheared.
But on my case, it isn't appearing as planned.
This is my code:(just ignore the //
after the //this is where...
<?php
if(isset($_POST['Submit'])){
// loop through the uploaded files
foreach ($_FILES as $key => $value) {
$image_tmp = $value['tmp_name'];
$image_type=$value['type'];
$image = $value['name'];
$image_file = "{$UPLOADDIR}{$image}";
//check if there's existing file name
if ($image != 0){
echo 'File Already Exists!';
} else {
// move the file to the permanent location
if(move_uploaded_file($image_tmp,$image_file)){
// this is where the shearing and displaying part goes
$shear = new Imagick($image_file);
$shear ->shearImage('grey', 10, 5);
$shear ->writeImage($UPLOADDIR.'sheared-'.$image);
echo "<div style='float:left;margin-right:10px'>
<img src='{$shear}' alt='file not found' /></br>
</div>";
} else {
echo "<h1>image file upload failed, image too big after compression</h1>";
}
}
} // end foreach
}
?>
Thank you so much for your response