diff --git a/app/format/create_thumbnail.php b/app/format/create_thumbnail.php new file mode 100644 index 0000000..92debfc --- /dev/null +++ b/app/format/create_thumbnail.php @@ -0,0 +1,20 @@ +resizeImage($resolution,null,null,1,null); + $thumbnail->writeImage($thumbnail_path); + + return "success"; + } catch (Exception $e) { + return $e; + } +} \ No newline at end of file diff --git a/app/image/image.php b/app/image/image.php index 26eda47..557b83d 100644 --- a/app/image/image.php +++ b/app/image/image.php @@ -40,6 +40,10 @@ if (isset($_POST['submit_delete'])) { if (is_file("../../images/thumbnails/".$image_array['imagename'])) { unlink("../../images/thumbnails/".$image_array['imagename']); } + // Delete preview if exitsts + if (is_file("../../images/previews/".$image_array['imagename'])) { + unlink("../../images/previews/".$image_array['imagename']); + } // TP user to the homepage with a success message ?> - 300) { + $make_thumbnail = make_thumbnail($image_path, $thumb_dir.$image_newname, 300); + if ($make_thumbnail != "success") { + ?> + + 1000) { + $make_preview = make_thumbnail($image_path, $preview_dir.$image_newname, 1000); + if ($make_preview != "success") { + ?> + + - - - - - - - - - - + + + + + + + + + + -