Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13053
file_61711.txt
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
•
bzimport
Nov 22 2014, 2:58 AM
2014-11-22 02:58:02 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
file_61711.txt
View Options
commit 692e4f9b68d596436f97db190df7bbcd9e361dda
Author: Brian Wolff <bawolff+wn@gmail.com>
Date: Sat Jun 21 17:29:38 2014 -0300
Add options to image magick to reduce memory usage.
Change-Id: I92d773a4f9bc8875527ed4ef1319dafddae6ff51
diff --git a/includes/media/Bitmap.php b/includes/media/Bitmap.php
index 44be178..253cddf 100644
--- a/includes/media/Bitmap.php
+++ b/includes/media/Bitmap.php
@@ -314,7 +314,7 @@ class BitmapHandler extends ImageHandler {
protected function transformImageMagick( $image, $params ) {
# use ImageMagick
global $wgSharpenReductionThreshold, $wgSharpenParameter, $wgMaxAnimatedGifArea,
- $wgImageMagickTempDir, $wgImageMagickConvertCommand;
+ $wgImageMagickTempDir, $wgImageMagickConvertCommand, $wgMaxShellMemory;
$quality = array();
$sharpen = array();
@@ -389,6 +389,15 @@ class BitmapHandler extends ImageHandler {
$animation_post,
array( $this->escapeMagickOutput( $params['dstPath'] ) ) ) );
+ // Setting some memory limit image magick memory limit variables seems to help
+ // prevent im from going over its memory limit. The affect seems particularly
+ // noticable with animated gif images when using cgroups. These values were
+ // chosen by trial and error on my local computer. See also:
+ // http://www.imagemagick.org/script/command-line-options.php#limit
+ $fiftyMB = 50 * 1024 * 1024;
+ $env['MAGICK_MAP_LIMIT'] = $fiftyMB;
+ $env['MAGICK_AREA_LIMIT'] = $env['MAGICK_MEMORY_LIMIT'] = $wgMaxShellMemory * 1024 - $fiftyMB;
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
12494
Default Alt Text
file_61711.txt (1 KB)
Attached To
Mode
T63711: Out of memory for some GIF thumbnail versions of animated GIF images on Commons (exceeding the 50 MP limit?)
Attached
Detach File
Event Timeline
Log In to Comment