![]() |
thumbnail litter I've found that if someone tries to upload an image that is smaller than the minimum set in admin panel then the thumbnail is created but the larger image is not and the user is given an error. Ok so far but the thumbnail is left as a zombie out in the thumbs directory and doesn't show up in the users gallery. I wouldn't expect the image to show up but the upload should clean up after itself if it gets an error. Is there any automated way to clean up these zombie files? |
If a file is tried to upload under the minimum settings it should give error saying it is too small You have some examples here |
Quote:
|
So you have no example to provide okay well I will need to do testing |
It's pretty easy to verify just try and upload a file that's too small then go look for the filename. |
HMM how about in image-inc.php make this change in bold and test Code: Content visible to verified customers only. |
test Will do - it will be this evening before I get to it though. |
Chuck I think something like this needs to happen. When the diewell is hit that doesn't write a record to the db then the product code doesn't display the image. When it dies then there is a file left in the upload directory, a file left in the thumb directory, and a file left in $filepath. This code cleans up the problem in the case I tested - the only thing I'm not sure about is how the paths might be affected by trying to upload images into albums or other cat dirs. Can you shed any light on that? // Too small? if ( ($Globals['minwidth'] > 0 && $imagewidth < $Globals['minwidth']) || ($Globals['minheight'] > 0 && $imageheight < $Globals['minheight']) ) { // @unlink($realname); commented out by GCS // remove the large file @unlink($filepath); // remove the thumbnail $thumbpath = "{$Globals['datafull']}$thecat/thumbs/$realname"; @unlink($thumbpath); // remove the file from the uploads directory $upimgname = "{$Globals['PP_PATH']}/uploads/$upuserid/$realname"; @unlink($upimgname); diewell( "Your graphic $realname is too small!<br /><br />Images must be at least {$Globals['minwidth']}x{$Globals['minheight']}" ); } |
The edit I noted is correct |
what version of software you using? The lines I noted above is the edit needed |
Well yes what you wrote will remove the file from one of the 3 places that it exists. |
Version 5.62 |
And what places do you think it does not get removed from? |
mods After modifying the code to unlink($filepath) only, the image still remains in the ($thecat)/thumbs directory and it remains in the /uploads/(userid) directory. |
Your code should work |
It has based some more testing I've done. |
| All times are GMT -5. The time now is 06:54 PM. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0