changeset 310:b1fc8a908eac

Get med/tn image sizes after they have been generated.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 04 Apr 2020 17:52:42 +0300
parents db2cd0fcd64b
children 8fd5c850f921
files mgtool.php
diffstat 1 files changed, 24 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/mgtool.php	Fri Apr 03 17:12:39 2020 +0300
+++ b/mgtool.php	Sat Apr 04 17:52:42 2020 +0300
@@ -985,27 +985,6 @@
             foreach ($galExifConversions as $conv)
               mgCopyEntryData($edata, $exif, $conv[GEC_TYPE], $conv[GEC_NAME], $conv[GEC_FIELDS]);
           }
-
-          // Get width/height information for thumbnails and mediums
-          $edata["med"] = [];
-          if (($info = getimagesize($medFilename)) !== FALSE && count($info) >= 2)
-          {
-            $edata["med"]["width"] = $info[0];
-            $edata["med"]["height"] = $info[1];
-            echo "+";
-          }
-          else
-            echo "-";
-
-          $edata["tn"] = [];
-          if (($info = @getimagesize($tnFilename)) !== FALSE && count($info) > 0)
-          {
-            $edata["tn"]["width"] = $info[0];
-            $edata["tn"]["height"] = $info[1];
-            echo "+";
-          }
-          else
-            echo "-";
         }
         else
         {
@@ -1048,6 +1027,30 @@
           if (($tmpData = @file_get_contents($capFilename)) !== FALSE)
             $edata["caption"] = $tmpData;
         }
+
+        if ($updFlags & GUPD_EXIF_INFO)
+        {
+          // Get width/height information for thumbnails and mediums
+          $edata["med"] = [];
+          if (($info = getimagesize($medFilename)) !== FALSE && count($info) >= 2)
+          {
+            $edata["med"]["width"] = $info[0];
+            $edata["med"]["height"] = $info[1];
+            echo "+";
+          }
+          else
+            echo "-";
+
+          $edata["tn"] = [];
+          if (($info = @getimagesize($tnFilename)) !== FALSE && count($info) > 0)
+          {
+            $edata["tn"]["width"] = $info[0];
+            $edata["tn"]["height"] = $info[1];
+            echo "+";
+          }
+          else
+            echo "-";
+        }
       }
       else
       if ($edata["type"] == 1)