Last time, perhaps
authorChuck Scott <cscott@gaslightmedia.com>
Mon, 11 May 2015 20:45:37 +0000 (16:45 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Mon, 11 May 2015 20:45:37 +0000 (16:45 -0400)
classes/glmMemberImportFromConnections.php
lib/GlmDataAbstract/DataAbstract.php

index 1155836..ec02eae 100644 (file)
@@ -569,15 +569,12 @@ class GlmMemberImportFromConnections
 
                 // If there's an entry in the $sizes array, it means that the image resized to this size
                 if (isset($sizes[$k])) {
-echo GLM_MEMBERS_PLUGIN_IMAGES_PATH.'/'.$sizes[$k]['file'].' => '.GLM_MEMBERS_PLUGIN_IMAGES_PATH.'/'.$k.'/'.$newFilename."<br>";
                     // 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 {
-echo GLM_MEMBERS_PLUGIN_IMAGES_PATH.'/'.$newFilename.' => '.GLM_MEMBERS_PLUGIN_IMAGES_PATH.'/'.$k.'/'.$newFilename."<br>";
                     // 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);
-
                 }
             }
 
index e7eaf11..94c357f 100755 (executable)
@@ -2292,6 +2292,7 @@ abstract class GlmDataAbstract
             while (list($k, $v) = each($this->config['imageSizes'])) {
                 unlink(GLM_MEMBERS_PLUGIN_IMAGES_PATH.'/'.$k.'/'.$current_img);
             }
+            unlink(GLM_MEMBERS_PLUGIN_IMAGES_PATH.'/'.$current_img);
 
             $current_img = '';
 
@@ -2338,6 +2339,7 @@ abstract class GlmDataAbstract
 
                         // 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 {
 
@@ -2348,7 +2350,7 @@ abstract class GlmDataAbstract
                 }
 
                 // Remove original
-                unlink(GLM_MEMBERS_PLUGIN_IMAGES_PATH.'/'.$newFilename);
+//                unlink(GLM_MEMBERS_PLUGIN_IMAGES_PATH.'/'.$newFilename);
 
                 $current_img = $newFilename;