Index: trunk/extensions/ProofreadPage/ProofreadPage.php |
— | — | @@ -20,6 +20,9 @@ |
21 | 21 | # Bump the version number every time you change proofread.js |
22 | 22 | $wgProofreadPageVersion = 20; |
23 | 23 | |
| 24 | +# Max width of zoomable image |
| 25 | +$wgProofreadPageMaxWidth = 2048; |
| 26 | + |
24 | 27 | $wgExtensionCredits['other'][] = array( |
25 | 28 | 'path' => __FILE__, |
26 | 29 | 'name' => 'ProofreadPage', |
— | — | @@ -291,7 +294,7 @@ |
292 | 295 | |
293 | 296 | |
294 | 297 | function pr_preparePage( $out, $m, $isEdit ) { |
295 | | - global $wgJsMimeType, $wgScriptPath, $wgRequest, $wgProofreadPageVersion; |
| 298 | + global $wgJsMimeType, $wgScriptPath, $wgRequest, $wgProofreadPageVersion, $wgProofreadPageMaxWidth; |
296 | 299 | |
297 | 300 | $imageTitle = Title::makeTitleSafe( NS_IMAGE, $m[1] ); |
298 | 301 | if ( !$imageTitle ) { |
— | — | @@ -302,6 +305,10 @@ |
303 | 306 | if ( $image && $image->exists() ) { |
304 | 307 | $width = $image->getWidth(); |
305 | 308 | $height = $image->getHeight(); |
| 309 | + if( $width > $wgProofreadPageMaxWidth ) { |
| 310 | + $width = $wgProofreadPageMaxWidth; |
| 311 | + $height = $image->getHeight() * $wgProofreadPageMaxWidth / $image->getWidth(); |
| 312 | + } |
306 | 313 | if ( $m[2] ) { |
307 | 314 | $viewName = $image->thumbName( array( 'width' => $width, 'page' => $m[3] ) ); |
308 | 315 | $viewURL = $image->getThumbUrl( $viewName ); |