# HG changeset patch # User Matti Hamalainen # Date 1464176272 -10800 # Node ID d555734526d60946fa621a83f37360754e733eef # Parent bc9da3b718881c683880d9faebe92c81151da42f Use newer PHP array syntax. diff -r bc9da3b71888 -r d555734526d6 mgtool.php --- 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]; } }