Class for reading xmp data containing properties relevant to images, and spitting out an array that FormatMetadata accepts.
More...
|
| __construct (LoggerInterface $logger=null, $filename='unknown') |
| Primary job is to initialize the XMLParser.
|
|
| getResults () |
| Get the result array.
|
|
| parse ( $content, $allOfIt=true) |
| Main function to parse XMP.
|
|
| parseExtended ( $content) |
| Entry point for XMPExtended blocks in jpeg files.
|
|
| char ( $parser, $data) |
| Character data handler Called whenever character data is found in the xmp document.
|
|
| endElement ( $parser, $elm) |
| Handler for hitting a closing element.
|
|
| startElement ( $parser, $elm, $attribs) |
| Hits an opening element.
|
|
Class for reading xmp data containing properties relevant to images, and spitting out an array that FormatMetadata accepts.
Note, this is not meant to recognize every possible thing you can encode in XMP. It should recognize all the properties we want. For example, it doesn't have support for structures with multiple nesting levels, as none of the properties we're supporting use that feature. If it comes across properties it doesn't recognize, it should ignore them.
The public methods one would call in this class are
- parse( $content ) Reads in xmp content. Can potentially be called multiple times with partial data each time.
- parseExtended( $content ) Reads XMPExtended blocks (jpeg files only).
- getResults Outputs a results array.
Note XMP kind of looks like rdf. They are not the same thing - XMP is encoded as a specific subset of rdf. This class can read XMP. It cannot read rdf.
Wikimedia\XMPReader\Reader::char |
( |
| $parser, |
|
|
| $data ) |
Character data handler Called whenever character data is found in the xmp document.
does nothing if we're in MODE_IGNORE or if the data is whitespace throws an error if we're not in MODE_SIMPLE (as we're not allowed to have character data in the other modes).
As an example, this happens when we encounter XMP like: <exif:DigitalZoomRatio>0/10</exif:DigitalZoomRatio> and are processing the 0/10 bit.
- Parameters
-
resource | $parser | XMLParser reference to the xml parser |
string | $data | Character data |
- Exceptions
-
RuntimeException | On invalid data |