$this->charset = 'UTF-8';
break;
default:
- //this should be impossible to get to
+ // this should be impossible to get to
throw new RuntimeException( "Invalid BOM" );
}
} else {
}
}
if ( $this->charset !== 'UTF-8' ) {
- //don't convert if already utf-8
+ // don't convert if already utf-8
MediaWiki\suppressWarnings();
$content = iconv( $this->charset, 'UTF-8//IGNORE', $content );
MediaWiki\restoreWarnings();
}
$len = unpack( 'Nlength/Noffset', substr( $content, 32, 8 ) );
- if ( !$len || $len['length'] < 4 || $len['offset'] < 0 || $len['offset'] > $len['length'] ) {
- $this->logger->info( __METHOD__ . 'Error reading extended XMP block, invalid length or offset.' );
+ if ( !$len ||
+ $len['length'] < 4 ||
+ $len['offset'] < 0 ||
+ $len['offset'] > $len['length']
+ ) {
+ $this->logger->info(
+ __METHOD__ . 'Error reading extended XMP block, invalid length or offset.'
+ );
return false;
}
// 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 ) {
* @throws RuntimeException
*/
private function endElementModeLi( $elm ) {
-
list( $ns, $tag ) = explode( ' ', $this->curItem[0], 2 );
$info = $this->items[$ns][$tag];
$finalName = isset( $info['map_name'] )
$this->results['xmp-' . $info['map_group']][$finalName]['_type'] = 'lang';
}
} else {
- throw new RuntimeException( __METHOD__ . " expected </rdf:seq> or </rdf:bag> but instead got $elm." );
+ throw new RuntimeException(
+ __METHOD__ . " expected </rdf:seq> or </rdf:bag> but instead got $elm."
+ );
}
}
// 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.
- //
- // also it seems as if exiv2 and exiftool do not support
+ // Also it seems as if exiv2 and exiftool do not support
// this either (That or I misunderstand the standard)
$this->logger->info( __METHOD__ . ' Encountered <rdf:type> which isn\'t currently supported' );
}
}
}
+ // @codingStandardsIgnoreStart Generic.Files.LineLength
/**
* Process attributes.
* Simple values can be stored as either a tag or attribute
* Often the initial "<rdf:Description>" tag just has all the simple
* properties as attributes.
*
- * @codingStandardsIgnoreStart Long line that cannot be broken
* @par Example:
* @code
* <rdf:Description rdf:about="" xmlns:exif="http://ns.adobe.com/exif/1.0/" exif:DigitalZoomRatio="0/10">
* @endcode
- * @codingStandardsIgnoreEnd
*
* @param array $attribs Array attribute=>value
* @throws RuntimeException
*/
+ // @codingStandardsIgnoreEnd
private function doAttribs( $attribs ) {
// first check for rdf:parseType attribute, as that can change
// how the attributes are interperted.