Merge "Match Parsoid's attribute sanitization for video elements"
[lhc/web/wiklou.git] / includes / media / Jpeg.php
index 8631553..29f0d7c 100644 (file)
@@ -114,8 +114,8 @@ class JpegHandler extends ExifBitmapHandler {
                        wfDebug( __METHOD__ . ': ' . $e->getMessage() . "\n" );
 
                        /* This used to use 0 (ExifBitmapHandler::OLD_BROKEN_FILE) for the cases
-                        *      * No metadata in the file
-                        *      * Something is broken in the file.
+                        *   * No metadata in the file
+                        *   * Something is broken in the file.
                         * However, if the metadata support gets expanded then you can't tell if the 0 is from
                         * a broken file, or just no props found. A broken file is likely to stay broken, but
                         * a file which had no props could have props once the metadata support is improved.
@@ -132,7 +132,7 @@ class JpegHandler extends ExifBitmapHandler {
         * @param array $params Rotate parameters.
         *    'rotation' clockwise rotation in degrees, allowed are multiples of 90
         * @since 1.21
-        * @return bool
+        * @return bool|MediaTransformError
         */
        public function rotate( $file, $params ) {
                global $wgJpegTran;
@@ -205,7 +205,7 @@ class JpegHandler extends ExifBitmapHandler {
                        // we'll also add TinyRGB profile to images lacking a profile, but
                        // only if they're not low quality (which are meant to save bandwith
                        // and we don't want to increase the filesize by adding a profile)
-                       if ( $params['quality'] > 30 ) {
+                       if ( isset( $params['quality'] ) && $params['quality'] > 30 ) {
                                $profiles[] = '-';
                        }