$fInfo = pathinfo($image);
$newFilename = $fInfo['filename'].'_'.time().'.'.$fInfo['extension'];
- // Get image temp file name - Not currently using, but should be using to check for resizing sanity
- $size = $newImage->get_size();
-
// Try to store the image using that file name in the 'original' directory
$storedImage = $newImage->save( GLM_MEMBERS_PLUGIN_IMAGES_PATH.'/'.$newFilename );
if (isset($sizes[$k])) {
// Move resized file to desired direectory
rename(GLM_MEMBERS_PLUGIN_IMAGES_PATH.'/'.$sizes[$k]['file'], GLM_MEMBERS_PLUGIN_IMAGES_PATH.'/'.$k.'/'.$newFilename);
- unlink(GLM_MEMBERS_PLUGIN_IMAGES_PATH.'/'.$sizes[$k]['file']);
} else {
// Image didn't resize to this size, probably because it was smaller than the destination size (silly WP Image Editor class) - so just use the original
copy(GLM_MEMBERS_PLUGIN_IMAGES_PATH.'/'.$newFilename, GLM_MEMBERS_PLUGIN_IMAGES_PATH.'/'.$k.'/'.$newFilename);