changeset 313:d94b0ebe97c6

Add some commented out / unused example code in mgParseXMPData().
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 06 Apr 2020 18:37:49 +0300
parents 326935332784
children 020d155a179d
files mgtool.php
diffstat 1 files changed, 15 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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);