changeset 45:d555734526d6

Use newer PHP array syntax.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 25 May 2016 14:37:52 +0300
parents bc9da3b71888
children e58292065b01
files mgtool.php
diffstat 1 files changed, 18 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/mgtool.php	Thu May 19 10:11:32 2016 +0300
+++ b/mgtool.php	Wed May 25 14:37:52 2016 +0300
@@ -11,21 +11,22 @@
 // Array for specifying what will be copied and converted
 // from the image file's EXIF information tag(s).
 //
-$galExifConversions = array(
-  array(MG_STR, "caption"     , "ImageDescription"),
-  array(MG_STR, "copyright"   , "Copyright"),
-  array(MG_STR, "model"       , "Model"),
-  array(MG_INT, "width"       , array("COMPUTED", "Width")),
-  array(MG_INT, "height"      , array("COMPUTED", "Height")),
-  array(MG_DVA, "fnumber"     , "FNumber"),
-  array(MG_DVA, "exposure"    , "ExposureTime"),
-  array(MG_INT, "iso"         , "ISOSpeedRatings"),
-  array(MG_STR, "lensmodel"   , "UndefinedTag:0xA434"),
-  array(MG_DVA, "focallength" , "FocalLength"),
-  array(MG_STR, "datetime"    , "DateTimeOriginal"),
-  array(MG_STR, "datetime"    , "DateTimeDigitized"),
-  array(MG_INT, "filesize"    , "FileSize"),
-);
+$galExifConversions =
+[
+  [ MG_STR, "caption"     , "ImageDescription" ],
+  [ MG_STR, "copyright"   , "Copyright" ],
+  [ MG_STR, "model"       , "Model" ],
+  [ MG_INT, "width"       , ["COMPUTED", "Width"] ],
+  [ MG_INT, "height"      , ["COMPUTED", "Height"] ],
+  [ MG_DVA, "fnumber"     , "FNumber" ],
+  [ MG_DVA, "exposure"    , "ExposureTime" ],
+  [ MG_INT, "iso"         , "ISOSpeedRatings" ],
+  [ MG_STR, "lensmodel"   , "UndefinedTag:0xA434" ],
+  [ MG_DVA, "focallength" , "FocalLength" ],
+  [ MG_STR, "datetime"    , "DateTimeOriginal" ],
+  [ MG_STR, "datetime"    , "DateTimeDigitized" ],
+  [ MG_INT, "filesize"    , "FileSize" ],
+];
 
 define("GCMD_UPDATE"      , 1);
 define("GCMD_RESCAN"      , 2);
@@ -239,10 +240,10 @@
     if ($str != "#" && $str != "")
     {
       if (preg_match("/^([#%]?)\s*(\S+?)\s+(.+)$/", $str, $m))
-        $captions[$m[2]] = array("caption" => $m[3], "hide" => ($m[1] == "#"), "hide_contents" => ($m[1] == "%"), "used" => FALSE);
+        $captions[$m[2]] = ["caption" => $m[3], "hide" => ($m[1] == "#"), "hide_contents" => ($m[1] == "%"), "used" => FALSE];
       else
       if (preg_match("/^([#%]?)\s*(\S+?)$/", $str, $m))
-        $captions[$m[2]] = array("hide" => ($m[1] == "#"), "hide_contents" => ($m[1] == "%"), "used" => FALSE);
+        $captions[$m[2]] = ["hide" => ($m[1] == "#"), "hide_contents" => ($m[1] == "%"), "used" => FALSE];
     }
   }