From 460d97857d33baeeed00abdc3c4241ba3b279135 Mon Sep 17 00:00:00 2001 From: Silvio Date: Mon, 26 Apr 2010 16:21:51 -0300 Subject: Using URI for namespace configuration --- exif.class.php | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) (limited to 'exif.class.php') diff --git a/exif.class.php b/exif.class.php index 944ac9d..9ab080f 100644 --- a/exif.class.php +++ b/exif.class.php @@ -204,18 +204,15 @@ Class Exif { // Sort. $xmpmeta->Sort(); - // Get namespace. - $ns = $xmpmeta->GetNamespaceURI($config['ns']); - // Read XMP data. if ($config['type'] == 'property') { - $value = $xmpmeta->GetProperty($config['name'], $ns); + $value = $xmpmeta->GetProperty($config['name'], $config['ns']); } elseif ($config['type'] == 'array') { - $value = $xmpmeta->GetArrayItem($config['name'], $key, $ns); + $value = $xmpmeta->GetArrayItem($config['name'], $key, $config['ns']); } elseif ($config['type'] == 'struct') { - $value = $xmpmeta->GetStructField($ns, $config['struct'], $ns, $config['name']); + $value = $xmpmeta->GetStructField($config['ns'], $config['struct'], $config['ns'], $config['name']); } return $value; @@ -303,60 +300,60 @@ Class Exif { return array( 'headline' => array( 'name' => 'Headline', - 'ns' => 'photoshop', + 'ns' => 'http://ns.adobe.com/photoshop/1.0/', 'type' => 'property', ), 'authorsposition' => array( 'name' => 'AuthorsPosition', - 'ns' => 'photoshop', + 'ns' => 'http://ns.adobe.com/photoshop/1.0/', 'type' => 'property', ), 'instructions' => array( 'name' => 'Instructions', - 'ns' => 'photoshop', + 'ns' => 'http://ns.adobe.com/photoshop/1.0/', 'type' => 'property', ), 'subject' => array( 'name' => 'subject', - 'ns' => 'dc', + 'ns' => 'http://purl.org/dc/elements/1.1/', 'type' => 'array', ), 'description' => array( 'name' => 'description', - 'ns' => 'dc', + 'ns' => 'http://purl.org/dc/elements/1.1/', 'type' => 'array', ), 'creator' => array( 'name' => 'creator', - 'ns' => 'dc', + 'ns' => 'http://purl.org/dc/elements/1.1/', 'type' => 'array', ), 'rights' => array( 'name' => 'rights', - 'ns' => 'dc', + 'ns' => 'http://purl.org/dc/elements/1.1/', 'type' => 'array', ), 'ciadrextadr' => array( 'name' => 'CiAdrExtadr', - 'ns' => 'Iptc4XmpCore', + 'ns' => 'http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/', 'type' => 'struct', 'struct' => 'CreatorContactInfo', ), 'ciemailwork' => array( 'name' => 'CiEmailWork', - 'ns' => 'Iptc4XmpCore', + 'ns' => 'http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/', 'type' => 'struct', 'struct' => 'CreatorContactInfo', ), 'ciurlwork' => array( 'name' => 'CiUrlWork', - 'ns' => 'Iptc4XmpCore', + 'ns' => 'http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/', 'type' => 'struct', 'struct' => 'CreatorContactInfo', ), 'scene' => array( 'name' => 'Scene', - 'ns' => 'Iptc4XmpCore', + 'ns' => 'http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/', 'type' => 'array', ), 'hierarchicalsubject' => array( @@ -366,7 +363,7 @@ Class Exif { ), 'location' => array( 'name' => 'Location', - 'ns' => 'Iptc4XmpCore', + 'ns' => 'http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/', 'type' => 'property', ), ); -- cgit v1.2.3