Few more comment/whitespace issues from r86169
authorSam Reed <reedy@users.mediawiki.org>
Mon, 18 Apr 2011 13:18:15 +0000 (13:18 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Mon, 18 Apr 2011 13:18:15 +0000 (13:18 +0000)
includes/media/Bitmap.php
includes/media/Exif.php
includes/media/FormatMetadata.php
includes/media/GIFMetadataExtractor.php
includes/media/IPTC.php
includes/media/JpegMetadataExtractor.php
includes/media/PNG.php
includes/media/XMP.php

index 8011a2d..f230d41 100644 (file)
@@ -808,6 +808,7 @@ class BitmapHandler extends ImageHandler {
                }
                return 0;
        }
+
        /**
         * Returns whether the current scaler supports rotation (im and gd do)
         * 
index d41b654..fdb5a49 100644 (file)
@@ -805,6 +805,5 @@ class Exif {
                        wfDebugLog( $this->log, "$class::$fname: end processing: '{$this->basename}'\n" );
                }
        }
-
 }
 
index f6abb70..38de34d 100644 (file)
@@ -919,6 +919,7 @@ class FormatMetadata {
                        }
                }
        }
+
        /** Helper function for creating lists of translations.
         *
         * @param $value String value (this is not escaped)
@@ -982,6 +983,7 @@ class FormatMetadata {
                $item .= "</li>\n";
                return $item;
        }
+
        /**
         * Convenience function for getFormattedData()
         *
@@ -1165,6 +1167,7 @@ class FormatMetadata {
                }
                return $val;
        }
+
        /**
         * Format a coordinate value, convert numbers from floating point
         * into degree minute second representation.
@@ -1204,6 +1207,7 @@ class FormatMetadata {
 
                return wfMsg( 'exif-coordinate-format', $deg, $min, $sec, $ref, $coord );
        }
+
        /**
         * Format the contact info field into a single value.
         *
index 86d624b..a3d3ced 100644 (file)
@@ -28,6 +28,11 @@ class GIFMetadataExtractor {
        // blocks, where it's usually between 32-127 bytes each.
        const MAX_SUBBLOCKS = 262144; // 5mb divided by 20.
 
+       /**
+        * @throws Exception
+        * @param $filename string
+        * @return array
+        */
        static function getMetadata( $filename ) {
                self::$gif_frame_sep = pack( "C", ord("," ) );
                self::$gif_extension_sep = pack( "C", ord("!" ) );
@@ -219,6 +224,11 @@ class GIFMetadataExtractor {
                );
        }
 
+       /**
+        * @param $fh
+        * @param $bpp
+        * @return void
+        */
        static function readGCT( $fh, $bpp ) {
                if ( $bpp > 0 ) {
                        for( $i=1; $i<=pow( 2, $bpp ); ++$i ) {
@@ -227,6 +237,10 @@ class GIFMetadataExtractor {
                }
        }
 
+       /**
+        * @param $data
+        * @return int
+        */
        static function decodeBPP( $data ) {
                $buf = unpack( 'C', $data );
                $buf = $buf[1];
@@ -238,6 +252,10 @@ class GIFMetadataExtractor {
                return $have_map ? $bpp : 0;
        }
 
+       /**
+        * @param $fh
+        * @return
+        */
        static function skipBlock( $fh ) {
                while ( !feof( $fh ) ) {
                        $buf = fread( $fh, 1 );
index dcc21e7..a86833a 100644 (file)
@@ -102,7 +102,7 @@ class IPTC {
                                        break;
                                case '2#115': /* source */
                                        /* "Identifies the original owner of the intellectual content of the
-                                        *objectdata. This could be an agency, a member of an agency or 
+                                        *objectdata. This could be an agency, a member of an agency or
                                         *an individual." */
                                        $data['Source'] = self::convIPTC( $val, $c );
                                        break;
@@ -329,9 +329,10 @@ class IPTC {
        /**
        * Convert an iptc date and time tags into the exif format
        *
-       * @todo Potentially this should also capture the timezone offset. 
+       * @todo Potentially this should also capture the timezone offset.
        * @param Array $date The date tag
        * @param Array $time The time tag
+       * @param $c
        * @return String Date in exif format.
        */
        private static function timeHelper( $date, $time, $c ) {
@@ -351,7 +352,7 @@ class IPTC {
                        $dateOnly = true;
                }
 
-               if ( ! ( preg_match('/\d\d\d\d\d\d[-+]\d\d\d\d/', $time) 
+               if ( ! ( preg_match('/\d\d\d\d\d\d[-+]\d\d\d\d/', $time)
                        && preg_match('/\d\d\d\d\d\d\d\d/', $date)
                        && substr($date, 0, 4) !== '0000'
                        && substr($date, 4, 2) !== '00'
@@ -390,13 +391,14 @@ class IPTC {
                } else {
                        return $finalTimestamp;
                }
-
        }
 
        /**
        * Helper function to convert charset for iptc values.
        * @param $data Mixed String or Array: The iptc string
        * @param $charset String: The charset
+        *
+        * @return string
        */
        private static function convIPTC ( $data, $charset ) {
                if ( is_array( $data ) ) {
@@ -404,7 +406,7 @@ class IPTC {
                                $val = self::convIPTCHelper( $val, $charset );
                        }
                } else {
-                       $data = self::convIPTCHelper ( $data, $charset );
+                       $data = self::convIPTCHelper( $data, $charset );
                }
 
                return $data;
@@ -413,6 +415,8 @@ class IPTC {
        * Helper function of a helper function to convert charset for iptc values.
        * @param $data Mixed String or Array: The iptc string
        * @param $charset String: The charset
+       *
+       * @return string
        */
        private static function convIPTCHelper ( $data, $charset ) {
                if ( $charset ) {
@@ -431,7 +435,7 @@ class IPTC {
                        if ($data === $oldData) {
                                return $data; //if validation didn't change $data
                        } else {
-                               return self::convIPTCHelper ( $oldData, 'Windows-1252' );
+                               return self::convIPTCHelper( $oldData, 'Windows-1252' );
                        }
                }
                return trim( $data );
@@ -439,8 +443,8 @@ class IPTC {
 
        /**
        * take the value of 1:90 tag and returns a charset
-       * @param String $tag 1:90 tag. 
-       * @return charset name or "?"
+       * @param String $tag 1:90 tag.
+       * @return string charset name or "?"
        * Warning, this function does not (and is not intended to) detect
        * all iso 2022 escape codes. In practise, the code for utf-8 is the
        * only code that seems to have wide use. It does detect that code.
@@ -510,7 +514,7 @@ class IPTC {
                                $c = "NS_4551-1";
                                break;
                        case "\x1b(f": //iso646-FR
-                               $c = "NF_Z_62-010"; 
+                               $c = "NF_Z_62-010";
                                break;
                        case "\x1b(g":
                                $c = "PT2"; //iso646-PT2
@@ -563,7 +567,7 @@ class IPTC {
                                $c = 'CSN_369103';
                                break;
                        default:
-                               wfDebugLog('iptc', __METHOD__ . 'Unknown charset in iptc 1:90: ' . bin2hex( $tag ) ); 
+                               wfDebugLog('iptc', __METHOD__ . 'Unknown charset in iptc 1:90: ' . bin2hex( $tag ) );
                                //at this point just give up and refuse to parse iptc?
                                $c = false;
                }
index d95dbaf..984bbe0 100644 (file)
@@ -119,8 +119,8 @@ class JpegMetadataExtractor {
                }
                // shouldn't get here.
                throw new MWException( "Reached end of jpeg file unexpectedly" );
-
        }
+
        /**
        * Helper function for jpegSegmentSplitter
        * @param &$fh FileHandle for jpeg file
@@ -223,7 +223,5 @@ class JpegMetadataExtractor {
                } else { /*$realHash !== $recordedHash */
                        return 'iptc-bad-hash';
                }
-
        }
-
 }
index f688b4c..cd7b5d6 100644 (file)
@@ -14,7 +14,6 @@
 class PNGHandler extends BitmapHandler {
 
        const BROKEN_FILE = '0';
-       
 
        /**
         * @param File $image
index fd95f3c..b0a8116 100644 (file)
@@ -106,8 +106,6 @@ class XMPReader {
                        array( $this, 'endElement' ) );
 
                xml_set_character_data_handler( $this->xmlParser, array( $this, 'char' ) );
-
-
        }
 
        /** Destroy the xml parser
@@ -386,6 +384,7 @@ class XMPReader {
                }
 
        }
+
        /** When we hit a closing element in MODE_IGNORE
        * Check to see if this is the element we started to ignore,
        * in which case we get out of MODE_IGNORE
@@ -401,6 +400,7 @@ class XMPReader {
                return;
 
        }
+
        /**
        * Hit a closing element when in MODE_SIMPLE.
        * This generally means that we finished processing a
@@ -433,6 +433,7 @@ class XMPReader {
                array_shift( $this->mode );
 
        }
+
        /**
        * Hit a closing element in MODE_STRUCT, MODE_SEQ, MODE_BAG
        * generally means we've finished processing a nested structure.
@@ -540,6 +541,7 @@ class XMPReader {
                        throw new MWException( __METHOD__ . " expected </rdf:seq> or </rdf:bag> but instead got $elm." );
                }
        }
+
        /**
        * End element while in MODE_QDESC
        * mostly when ending an element when we have a simple value
@@ -563,6 +565,7 @@ class XMPReader {
 
 
        }
+
        /**
        * Handler for hitting a closing element.
        *
@@ -1063,6 +1066,7 @@ class XMPReader {
                                break;
                }
        }
+
        /**
        * Process attributes.
        * Simple values can be stored as either a tag or attribute
@@ -1115,6 +1119,7 @@ class XMPReader {
                        }
                }
        }
+
        /**
        * Given an extracted value, save it to results array
        *