From 4a5676d99783f9ff2096a2bc7f0ab1709850a3e7 Mon Sep 17 00:00:00 2001 From: Reedy Date: Thu, 6 Dec 2012 23:59:18 +0000 Subject: [PATCH] Leave some FIXME comments for Bug 36911 - Division by zero Change-Id: I994c482cad1d195cf29d18f7ccf1d8816b1e7330 --- includes/ImagePage.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/ImagePage.php b/includes/ImagePage.php index 316e1c95b1..ecf4f894e1 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -340,13 +340,13 @@ class ImagePage extends Article { if ( $width > $maxWidth || $height > $maxHeight ) { # Calculate the thumbnail size. # First case, the limiting factor is the width, not the height. - if ( $width / $height >= $maxWidth / $maxHeight ) { - $height = round( $height * $maxWidth / $width ); + if ( $width / $height >= $maxWidth / $maxHeight ) { // FIXME: Possible divison by 0. bug 36911 + $height = round( $height * $maxWidth / $width ); // FIXME: Possible divison by 0. bug 36911 $width = $maxWidth; # Note that $height <= $maxHeight now. } else { - $newwidth = floor( $width * $maxHeight / $height ); - $height = round( $height * $newwidth / $width ); + $newwidth = floor( $width * $maxHeight / $height ); // FIXME: Possible divison by 0. bug 36911 + $height = round( $height * $newwidth / $width ); // FIXME: Possible divison by 0. bug 36911 $width = $newwidth; # Note that $height <= $maxHeight now, but might not be identical # because of rounding. -- 2.20.1