class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
I've created an Image Resize interface that simply allows you to create thumbnails of images. The problem I'm having is the original file is being altered (or deleted) and I can't figure out what is going on.
This is the code: http://solepixel.pastebin.com/8pJi2Lcq
Here's a demo of the interface: http://screencast.com/t/ZTVjYzRi
In the video, the first time, the thumbnail isn't getting created. The 2nd time the original image gets deleted. It's supposed to be copying the original the first time and creating a thumb (-thumb.jpg) and just a straight up resize the 2nd time.
Anyone had this same issue know how to fix it?Reply
Re: Resize or Create Thumb - Deletes Original new!
This is the code:
http://solepixel.pastebin.com/8pJi2Lcq
Here's a demo of the interface:
http://screencast.com/t/ZTVjYzRi
In the video, the first time, the thumbnail isn't getting created. The 2nd time the original image gets deleted. It's supposed to be copying the original the first time and creating a thumb (-thumb.jpg) and just a straight up resize the 2nd time.
Anyone had this same issue know how to fix it?
If you use clean(), it will delete your source image. Remove the following line in your code:
clean() is used for uploads to delete the uploaded file, and eventually when working on local files if you want to delete your original file.