Mercurial > hg > mgallery
comparison mgtool.php @ 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 |
comparison
equal
deleted
inserted
replaced
312:326935332784 | 313:d94b0ebe97c6 |
---|---|
353 return FALSE; | 353 return FALSE; |
354 | 354 |
355 // Process structure to simple flat array of data for the desired elements only | 355 // Process structure to simple flat array of data for the desired elements only |
356 $xmpData = []; | 356 $xmpData = []; |
357 | 357 |
358 //if (($tmp = $xmpOb->xpath("RDF/Description/description/li")) !== FALSE) | 358 /* |
359 // $xmpData["description"] = (string) $xe[0]; | 359 // We get these from EXIF, or at least we should .. also EXIF contains information |
360 | 360 // that XMP does not have, for some reason (like width/height, ISO, etc.) |
361 // Leaving this code here just as an example. | |
362 if (($xres = $xmpOb->xpath("RDF/Description")) !== FALSE) | |
363 { | |
364 $tmp = $xres[0]->attributes(); | |
365 mgConvertAttribute($xmpData, $tmp, "lensmodel", "Lens"); | |
366 mgConvertAttribute($xmpData, $tmp, "datetime", "CreateDate"); | |
367 } | |
368 | |
369 if (($xres = $xmpOb->xpath("RDF/Description/description/li")) !== FALSE) | |
370 $xmpData["description"] = implode(" ", array_map(function($xe) { return (string) $xe; }, $xres)); | |
371 */ | |
372 | |
373 // What EXIF does NOT have are the keywords .. so grab them. | |
361 if (($xres = $xmpOb->xpath("RDF/Description/subject/li")) !== FALSE) | 374 if (($xres = $xmpOb->xpath("RDF/Description/subject/li")) !== FALSE) |
362 { | 375 { |
363 $xmpData["keywords"] = array_map(function($xkw) { return (string) $xkw; }, $xres); | 376 $xmpData["keywords"] = array_map(function($xkw) { return (string) $xkw; }, $xres); |
364 } | 377 } |
365 | 378 |