diff options
Diffstat (limited to 'includes/media/ExifBitmap.php')
-rw-r--r-- | includes/media/ExifBitmap.php | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/includes/media/ExifBitmap.php b/includes/media/ExifBitmap.php index 34a1f511..d8d0bede 100644 --- a/includes/media/ExifBitmap.php +++ b/includes/media/ExifBitmap.php @@ -34,8 +34,8 @@ class ExifBitmapHandler extends BitmapHandler { function convertMetadataVersion( $metadata, $version = 1 ) { // basically flattens arrays. - $version = explode(';', $version, 2); - $version = intval($version[0]); + $version = explode( ';', $version, 2 ); + $version = intval( $version[0] ); if ( $version < 1 || $version >= 2 ) { return $metadata; } @@ -51,12 +51,12 @@ class ExifBitmapHandler extends BitmapHandler { // Treat Software as a special case because in can contain // an array of (SoftwareName, Version). - if (isset( $metadata['Software'] ) + if ( isset( $metadata['Software'] ) && is_array( $metadata['Software'] ) - && is_array( $metadata['Software'][0]) + && is_array( $metadata['Software'][0] ) && isset( $metadata['Software'][0][0] ) - && isset( $metadata['Software'][0][1]) - ) { + && isset( $metadata['Software'][0][1] ) + ) { $metadata['Software'] = $metadata['Software'][0][0] . ' (Version ' . $metadata['Software'][0][1] . ')'; } @@ -84,9 +84,9 @@ class ExifBitmapHandler extends BitmapHandler { return self::METADATA_GOOD; } if ( $metadata === self::OLD_BROKEN_FILE ) { - # Old special value indicating that there is no EXIF data in the file. + # Old special value indicating that there is no Exif data in the file. # or that there was an error well extracting the metadata. - wfDebug( __METHOD__ . ": back-compat version\n"); + wfDebug( __METHOD__ . ": back-compat version\n" ); return self::METADATA_COMPATIBLE; } if ( $metadata === self::BROKEN_FILE ) { @@ -102,11 +102,11 @@ class ExifBitmapHandler extends BitmapHandler { $exif['MEDIAWIKI_EXIF_VERSION'] == 1 ) { //back-compatible but old - wfDebug( __METHOD__.": back-compat version\n" ); + wfDebug( __METHOD__ . ": back-compat version\n" ); return self::METADATA_COMPATIBLE; } # Wrong (non-compatible) version - wfDebug( __METHOD__.": wrong version\n" ); + wfDebug( __METHOD__ . ": wrong version\n" ); return self::METADATA_BAD; } return self::METADATA_GOOD; @@ -163,7 +163,7 @@ class ExifBitmapHandler extends BitmapHandler { $rotation = 0; } - if ($rotation == 90 || $rotation == 270) { + if ( $rotation == 90 || $rotation == 270 ) { $width = $gis[0]; $gis[0] = $gis[1]; $gis[1] = $width; @@ -225,4 +225,3 @@ class ExifBitmapHandler extends BitmapHandler { return 0; } } - |