# HG changeset patch # User Matti Hamalainen # Date 1586187469 -10800 # Node ID d94b0ebe97c6d23c28bd71b6f1e3863d5c1bd1bf # Parent 326935332784265b3ce3a317324804b2507398c6 Add some commented out / unused example code in mgParseXMPData(). diff -r 326935332784 -r d94b0ebe97c6 mgtool.php --- a/mgtool.php Mon Apr 06 18:36:23 2020 +0300 +++ b/mgtool.php Mon Apr 06 18:37:49 2020 +0300 @@ -355,9 +355,22 @@ // Process structure to simple flat array of data for the desired elements only $xmpData = []; - //if (($tmp = $xmpOb->xpath("RDF/Description/description/li")) !== FALSE) - // $xmpData["description"] = (string) $xe[0]; + /* + // We get these from EXIF, or at least we should .. also EXIF contains information + // that XMP does not have, for some reason (like width/height, ISO, etc.) + // Leaving this code here just as an example. + if (($xres = $xmpOb->xpath("RDF/Description")) !== FALSE) + { + $tmp = $xres[0]->attributes(); + mgConvertAttribute($xmpData, $tmp, "lensmodel", "Lens"); + mgConvertAttribute($xmpData, $tmp, "datetime", "CreateDate"); + } + if (($xres = $xmpOb->xpath("RDF/Description/description/li")) !== FALSE) + $xmpData["description"] = implode(" ", array_map(function($xe) { return (string) $xe; }, $xres)); + */ + + // What EXIF does NOT have are the keywords .. so grab them. if (($xres = $xmpOb->xpath("RDF/Description/subject/li")) !== FALSE) { $xmpData["keywords"] = array_map(function($xkw) { return (string) $xkw; }, $xres);