mirror of
https://github.com/Fluffy-Bean/image-gallery.git
synced 2025-05-23 20:04:55 +00:00
Added thumbnails and resolution to image info
This commit is contained in:
parent
fda00c7c31
commit
29eda68d8f
3 changed files with 35 additions and 7 deletions
|
@ -55,7 +55,8 @@
|
|||
// If image present, continue
|
||||
if ($get_image_name != "") {
|
||||
// Set file path for image upload
|
||||
$image_path = "images/".basename($get_image_name);
|
||||
$image_basename = basename($get_image_name);
|
||||
$image_path = "images/".$image_basename;
|
||||
$sql = "INSERT INTO swag_table (imagename, alt) VALUES ('$get_image_name','$get_alt_text')";
|
||||
|
||||
|
||||
|
@ -65,6 +66,11 @@
|
|||
|
||||
// Checking if image uploaded
|
||||
if (move_uploaded_file($_FILES['image']['tmp_name'], $image_path)) {
|
||||
// Make thumbnail
|
||||
$image_thumbnail = new Imagick($image_path);
|
||||
$image_thumbnail->resizeImage(300,null,null,1,null);
|
||||
$image_thumbnail->writeImage("images/thumbnails/".$image_basename);
|
||||
|
||||
header("Location:upload.php?r=success");
|
||||
}else{
|
||||
header("Location:upload.php?r=fail");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue