/** @var bool|string The structure name when processing nested structures. */
private $ancestorStruct = false;
/** @var bool|string The structure name when processing nested structures. */
private $ancestorStruct = false;
private $charContent = false;
/** @var array Stores the state the xmpreader is in (see MODE_FOO constants) */
private $charContent = false;
/** @var array Stores the state the xmpreader is in (see MODE_FOO constants) */
xml_parser_set_option( $this->xmlParser, XML_OPTION_SKIP_WHITE, 1 );
xml_set_element_handler( $this->xmlParser,
xml_parser_set_option( $this->xmlParser, XML_OPTION_SKIP_WHITE, 1 );
xml_set_element_handler( $this->xmlParser,
- array( $this, 'startElement' ),
- array( $this, 'endElement' ) );
+ [ $this, 'startElement' ],
+ [ $this, 'endElement' ] );
// detect encoding by looking for BOM which is supposed to be in processing instruction.
// see page 12 of http://www.adobe.com/devnet/xmp/pdfs/XMPSpecificationPart3.pdf
if ( !$this->charset ) {
// detect encoding by looking for BOM which is supposed to be in processing instruction.
// see page 12 of http://www.adobe.com/devnet/xmp/pdfs/XMPSpecificationPart3.pdf
if ( !$this->charset ) {
$this->logger->warning(
'{method} : Error reading XMP content: {error} ' .
'(line: {line} column: {column} byte offset: {offset})',
$this->logger->warning(
'{method} : Error reading XMP content: {error} ' .
'(line: {line} column: {column} byte offset: {offset})',
$this->destroyXMLParser();
return false;
}
} catch ( Exception $e ) {
$this->logger->warning(
'{method} Exception caught while parsing: ' . $e->getMessage(),
$this->destroyXMLParser();
return false;
}
} catch ( Exception $e ) {
$this->logger->warning(
'{method} Exception caught while parsing: ' . $e->getMessage(),
// immediately following the StandardXMP. However, the JPEG standard
// does not require preservation of marker segment order. A robust JPEG
// reader should tolerate the marker segments in any order."
// immediately following the StandardXMP. However, the JPEG standard
// does not require preservation of marker segment order. A robust JPEG
// reader should tolerate the marker segments in any order."
- //
- // otoh the probability that an image will have more than 128k of
- // metadata is rather low... so the probability that it will have
+ // On the other hand, the probability that an image will have more than
+ // 128k of metadata is rather low... so the probability that it will have
// > 128k, and be in the wrong order is very low...
if ( $len['offset'] !== $this->extendedXMPOffset ) {
// > 128k, and be in the wrong order is very low...
if ( $len['offset'] !== $this->extendedXMPOffset ) {
/** @noinspection PhpUnusedLocalVariableInspection */
$reset = new ScopedCallback(
'libxml_disable_entity_loader',
/** @noinspection PhpUnusedLocalVariableInspection */
$reset = new ScopedCallback(
'libxml_disable_entity_loader',
$this->logger->debug( __METHOD__ . " <$ns:$tag> has no valid members." );
} elseif ( is_callable( $validate ) ) {
$val =& $this->results['xmp-' . $info['map_group']][$finalName];
$this->logger->debug( __METHOD__ . " <$ns:$tag> has no valid members." );
} elseif ( is_callable( $validate ) ) {
$val =& $this->results['xmp-' . $info['map_group']][$finalName];
- call_user_func_array( $validate, array( $info, &$val, false ) );
+ call_user_func_array( $validate, [ $info, &$val, false ] );
// In practise I have yet to see a file that
// uses this element, however it is mentioned
// on page 25 of part 1 of the xmp standard.
// In practise I have yet to see a file that
// uses this element, however it is mentioned
// on page 25 of part 1 of the xmp standard.
// this either (That or I misunderstand the standard)
$this->logger->info( __METHOD__ . ' Encountered <rdf:type> which isn\'t currently supported' );
}
// this either (That or I misunderstand the standard)
$this->logger->info( __METHOD__ . ' Encountered <rdf:type> which isn\'t currently supported' );
}
private function doAttribs( $attribs ) {
// first check for rdf:parseType attribute, as that can change
// how the attributes are interperted.
private function doAttribs( $attribs ) {
// first check for rdf:parseType attribute, as that can change
// how the attributes are interperted.
- call_user_func_array( $validate, array( $info, &$val, true ) );
+ call_user_func_array( $validate, [ $info, &$val, true ] );
// the reasoning behind using &$val instead of using the return value
// is to be consistent between here and validating structures.
if ( is_null( $val ) ) {
// the reasoning behind using &$val instead of using the return value
// is to be consistent between here and validating structures.
if ( is_null( $val ) ) {