changeset 188:a5ce6144fbf5

Add an option to clean medium images separately from thumbnails.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 14 Mar 2018 15:30:44 +0200
parents 5cb0ab0f694d
children 5e7319ccb7cf
files mgtool.php
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mgtool.php	Wed Mar 14 15:25:15 2018 +0200
+++ b/mgtool.php	Wed Mar 14 15:30:44 2018 +0200
@@ -35,6 +35,7 @@
 
 define("GCLEAN_CACHES"    , 0x01);
 define("GCLEAN_THUMBNAILS", 0x02);
+define("GCLEAN_MEDIUMS"   , 0x04);
 define("GCLEAN_ALL"       , 0x0f);
 
 define("GUPD_MED_IMAGE"   , 0x01);
@@ -502,7 +503,7 @@
       if ($galCleanFlags & GCLEAN_THUMBNAILS)
         mgDelete($path."/".$galTNPath, FALSE);
 
-      if ($galCleanFlags & GCLEAN_THUMBNAILS)
+      if ($galCleanFlags & GCLEAN_MEDIUMS)
         mgDelete($path."/".$galMedPath, FALSE);
     }
   }
@@ -792,7 +793,7 @@
     "    and EXIF/caption/etc information to be re-scanned even\n".
     "    if the file timestamps do not justify re-scanning.\n".
     "\n".
-    "  clean <all|caches|thumbnails> [path]\n".
+    "  clean <all|caches|thumbnails|mediums|generated> [path]\n".
     "    Delete all generated files or selectively cache files or\n".
     "    everything inside thumbnail directories.\n".
     "\n".
@@ -858,6 +859,8 @@
       case "al": $galCleanFlags = GCLEAN_ALL; break;
       case "ca": $galCleanFlags = GCLEAN_CACHES; break;
       case "th": $galCleanFlags = GCLEAN_THUMBNAILS; break;
+      case "me": $galCleanFlags = GCLEAN_MEDIUMS; break;
+      case "ge": $galCleanFlags = GCLEAN_THUMBNAILS | GCLEAN_MEDIUMS; break;
       case FALSE:
         mgFatal("Cleaning requires a mode argument.\n");