dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Doc fixes for MediaHandler. No behaviour changes.
[lhc/web/wiklou.git]
/
includes
/
media
/
BitmapMetadataHandler.php
diff --git
a/includes/media/BitmapMetadataHandler.php
b/includes/media/BitmapMetadataHandler.php
index
9c16fa7
..
7c39c81
100644
(file)
--- a/
includes/media/BitmapMetadataHandler.php
+++ b/
includes/media/BitmapMetadataHandler.php
@@
-52,9
+52,9
@@
class BitmapMetadataHandler {
*
* Mostly just calls doPSIR and doIPTC
*
*
* Mostly just calls doPSIR and doIPTC
*
- * @param
S
tring $app13 String containing app13 block from jpeg file
+ * @param
s
tring $app13 String containing app13 block from jpeg file
*/
*/
- private function doApp13
( $app13 ) {
+ private function doApp13( $app13 ) {
try {
$this->iptcType = JpegMetadataExtractor::doPSIR( $app13 );
} catch ( MWException $e ) {
try {
$this->iptcType = JpegMetadataExtractor::doPSIR( $app13 );
} catch ( MWException $e ) {
@@
-79,7
+79,7
@@
class BitmapMetadataHandler {
* @param $filename string
* @param $byteOrder string
*/
* @param $filename string
* @param $byteOrder string
*/
- function getExif
( $filename, $byteOrder ) {
+ function getExif( $filename, $byteOrder ) {
global $wgShowEXIF;
if ( file_exists( $filename ) && $wgShowEXIF ) {
$exif = new Exif( $filename, $byteOrder );
global $wgShowEXIF;
if ( file_exists( $filename ) && $wgShowEXIF ) {
$exif = new Exif( $filename, $byteOrder );
@@
-92,10
+92,10
@@
class BitmapMetadataHandler {
/** Add misc metadata. Warning: atm if the metadata category
* doesn't have a priority, it will be silently discarded.
*
/** Add misc metadata. Warning: atm if the metadata category
* doesn't have a priority, it will be silently discarded.
*
- * @param
A
rray $metaArray array of metadata values
+ * @param
a
rray $metaArray array of metadata values
* @param string $type type. defaults to other. if two things have the same type they're merged
*/
* @param string $type type. defaults to other. if two things have the same type they're merged
*/
- function addMetadata
( $metaArray, $type = 'other' ) {
+ function addMetadata( $metaArray, $type = 'other' ) {
if ( isset( $this->metadata[$type] ) ) {
/* merge with old data */
$metaArray = $metaArray + $this->metadata[$type];
if ( isset( $this->metadata[$type] ) ) {
/* merge with old data */
$metaArray = $metaArray + $this->metadata[$type];
@@
-113,7
+113,7
@@
class BitmapMetadataHandler {
*
* @return Array metadata array
*/
*
* @return Array metadata array
*/
- function getMetadataArray
() {
+ function getMetadataArray() {
// this seems a bit ugly... This is all so its merged in right order
// based on the MWG recomendation.
$temp = Array();
// this seems a bit ugly... This is all so its merged in right order
// based on the MWG recomendation.
$temp = Array();
@@
-143,11
+143,11
@@
class BitmapMetadataHandler {
/** Main entry point for jpeg's.
*
/** Main entry point for jpeg's.
*
- * @param
$filename string
filename (with full path)
+ * @param
string $filename
filename (with full path)
* @return array metadata result array.
* @throws MWException on invalid file.
*/
* @return array metadata result array.
* @throws MWException on invalid file.
*/
- static function Jpeg
( $filename ) {
+ static function Jpeg( $filename ) {
$showXMP = function_exists( 'xml_parser_create_ns' );
$meta = new self();
$showXMP = function_exists( 'xml_parser_create_ns' );
$meta = new self();
@@
-156,7
+156,7
@@
class BitmapMetadataHandler {
$meta->addMetadata( Array( 'JPEGFileComment' => $seg['COM'] ), 'native' );
}
if ( isset( $seg['PSIR'] ) && count( $seg['PSIR'] ) > 0 ) {
$meta->addMetadata( Array( 'JPEGFileComment' => $seg['COM'] ), 'native' );
}
if ( isset( $seg['PSIR'] ) && count( $seg['PSIR'] ) > 0 ) {
- foreach( $seg['PSIR'] as $curPSIRValue ) {
+ foreach
( $seg['PSIR'] as $curPSIRValue ) {
$meta->doApp13( $curPSIRValue );
}
}
$meta->doApp13( $curPSIRValue );
}
}
@@
-186,10
+186,10
@@
class BitmapMetadataHandler {
* merge the png various tEXt chunks to that
* are interesting, but for now it only does XMP
*
* merge the png various tEXt chunks to that
* are interesting, but for now it only does XMP
*
- * @param
$filename String
full path to file
+ * @param
string $filename
full path to file
* @return Array Array for storage in img_metadata.
*/
* @return Array Array for storage in img_metadata.
*/
- public static function PNG
( $filename ) {
+ public static function PNG( $filename ) {
$showXMP = function_exists( 'xml_parser_create_ns' );
$meta = new self();
$showXMP = function_exists( 'xml_parser_create_ns' );
$meta = new self();
@@
-215,10
+215,10
@@
class BitmapMetadataHandler {
* They don't really have native metadata, so just merges together
* XMP and image comment.
*
* They don't really have native metadata, so just merges together
* XMP and image comment.
*
- * @param
$filename string
full path to file
+ * @param
string $filename
full path to file
* @return Array metadata array
*/
* @return Array metadata array
*/
- public static function GIF
( $filename ) {
+ public static function GIF( $filename ) {
$meta = new self();
$baseArray = GIFMetadataExtractor::getMetadata( $filename );
$meta = new self();
$baseArray = GIFMetadataExtractor::getMetadata( $filename );
@@
-259,7
+259,7
@@
class BitmapMetadataHandler {
* @throws MWException
* @return Array The metadata.
*/
* @throws MWException
* @return Array The metadata.
*/
- public static function Tiff
( $filename ) {
+ public static function Tiff( $filename ) {
if ( file_exists( $filename ) ) {
$byteOrder = self::getTiffByteOrder( $filename );
if ( !$byteOrder ) {
if ( file_exists( $filename ) ) {
$byteOrder = self::getTiffByteOrder( $filename );
if ( !$byteOrder ) {
@@
-281,16
+281,18
@@
class BitmapMetadataHandler {
* Read the first 2 bytes of a tiff file to figure out
* Little Endian or Big Endian. Needed for exif stuff.
*
* Read the first 2 bytes of a tiff file to figure out
* Little Endian or Big Endian. Needed for exif stuff.
*
- * @param
$filename String
The filename
+ * @param
string $filename
The filename
* @return String 'BE' or 'LE' or false
*/
static function getTiffByteOrder( $filename ) {
$fh = fopen( $filename, 'rb' );
* @return String 'BE' or 'LE' or false
*/
static function getTiffByteOrder( $filename ) {
$fh = fopen( $filename, 'rb' );
- if ( !$fh ) return false;
+ if ( !$fh ) {
+ return false;
+ }
$head = fread( $fh, 2 );
fclose( $fh );
$head = fread( $fh, 2 );
fclose( $fh );
- switch( $head ) {
+ switch
( $head ) {
case 'II':
return 'LE'; // II for intel.
case 'MM':
case 'II':
return 'LE'; // II for intel.
case 'MM':