php - getimagesize error -


My upload / crop function is working almost exactly how I want it to show the uploaded image of your page To refresh, except Im .. And then when I delete the image after removing my code, I delete the image using the Delete button, I get 2 errors shown in my header. I do not give up until I refresh the page. The following errors disappear from the view until I delete the uploaded image again.

Here are two errors and then code actions with getimagesize have been marked as bold. Warning: getimagesize (imgs / pic7.jpg) [function.getimagesize]: failed to open the stream: there is no such file or directory ----- Warning on line 48: getimagesize ( Imgs / pic7.jpg) [function.getimagesize]: Failed to open the stream: ------ 42

There are no such files or directories in the form of bold Problem with errors -

  $ id = $ _ session ['id']; $ Upload_dir = "IMGS"; // Save images to directory $ upload_path = $ Upload_dir for images. "/"; // where the image will be saved from path $ big_image_name = "pic". $ Id ".jpg"; // Big image new name $ thumb_image_name = "crop". $ Id ".jpg"; $ Max_file = "1148576"; // approximately $ 1MB max_width = "500"; Max width $ thumb_width = "100" for large image; // Thumbnail image width $ thumb_height = "100"; // thumbnail image // height height // You do not need to resize these functions, size resizeImage ($ image, $ width, $ height, $ scale) {$ newImageWidth = ceil ($ width * $ scale); $ NewImageHeight = CIL ($ height = $ scale); $ NewImage = imagecreatetruecolor ($ newImageWidth, $ newImageHyight); $ Source = imagecreatefromjpeg ($ image); Imagecopyresampled ($ newImage, $ source, 0,0,0,0, $ newImageWidth, $ newImageHeight, $ width, $ height); Imagejpeg ($ newImage, $ image, 90); Chmod ($ image, 0777); $ Image return; } // You do not need to resize these functions functions. Thumbnail image ($ thumb_image_name, $ image, $ width, $ height, $ start_width, $ start_height, $ scale) {$ newImageWidth = ceil ($ width * $ scale); $ NewImageHeight = CIL ($ height = $ scale); $ NewImage = imagecreatetruecolor ($ newImageWidth, $ newImageHyight); $ Source = imagecreatefromjpeg ($ image); Imagecopyresampled ($ newImage, $ source, 0,0, $ start_width, $ start_height, $ newImageWidth, $ newImageHeight, $ width, $ height); Imagejpeg ($ newImage, $ thumb_image_name, 90); Chmod ($ thumb_image_name, 0777); Return $ thumb_image_name; } // These function functions do not need to replace getHeight ($ image) {** $ size = matching ($ image); ** $ height = $ size [1]; Return height; } // These function function getWidth ($ image) {** $ sizes = matching ($ image); ** $ width = $ size [0]; Return width; }    

Calling on deleted image getimagesize ($ image) Definitely you should give the error file_exists ($ file_path) function. getimagesize ($ image) with the file before the call exists or not.

Comments