Enforce $wgSVGMaxSize when rendering, even for SVGs with a very large source size...
authorTim Starling <tstarling@users.mediawiki.org>
Tue, 10 Jan 2006 14:13:40 +0000 (14:13 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Tue, 10 Jan 2006 14:13:40 +0000 (14:13 +0000)
RELEASE-NOTES
includes/DefaultSettings.php
includes/Image.php

index e41d961..3dc6c27 100644 (file)
@@ -452,6 +452,8 @@ fully support the editing toolbar, but was found to be too confusing.
 * (bug 912) Search box easier to reach in text browsers (lynx, links)
 * $wgParserCacheExpireTime added
 * Skip loading of RecentChange.php except where needed
+* Enforce $wgSVGMaxSize when rendering, even for SVGs with a very large source 
+  size. This is necessary to limit server memory usage.
 
 
 === Caveats ===
index 1f8103d..3af6155 100644 (file)
@@ -1220,7 +1220,7 @@ $wgSVGConverters = array(
 $wgSVGConverter = 'ImageMagick';
 /** If not in the executable PATH, specify */
 $wgSVGConverterPath = '';
-/** Don't scale a SVG larger than this unless its native size is larger */
+/** Don't scale a SVG larger than this */
 $wgSVGMaxSize = 1024;
 /**
  * Don't thumbnail an image if it will use too much working memory
index 6b27f5e..17f3f8c 100644 (file)
@@ -945,11 +945,9 @@ class Image
                        return null;
                }
 
-               $maxsize = $this->mustRender()
-                       ? max( $this->width, $wgSVGMaxSize )
-                       : $this->width - 1;
+               # Don't make an image bigger than the source, or wgMaxSVGSize for SVGs
+               $maxsize = $this->mustRender() ? $wgSVGMaxSize : $this->width - 1;
                if( $width > $maxsize ) {
-                       # Don't make an image bigger than the source
                        $thumb = new ThumbnailImage( $this->getViewURL(), $this->getWidth(), $this->getHeight() );
                        wfProfileOut( $fname );
                        return $thumb;