You are on page 1of 2

JPEG

Symptom: This error message within a grey box:

Error creating thumbnail: Invalid thumbnail parameters


One cause: the number of pixels in the original image exceeding $wgMaxImageArea.
The default value 1.25e7 is too small for many modern cameras. Too bad the
diagnostic really doesn't hint at the problem.

You can increase the value of $wgMaxImageArea or switch to using ImageMagick which
evades this restriction (set $wgUseImageMagick and $wgImageMagickConvertCommand).

Large images can take significant processing time. It may be good policy to cap the
size of images.

JPEG (using GD)


Symptom: This error message within a grey box:

Error creating thumbnail: Incomplete GD library configuration: missing function


imagecreatefromjpeg
Some PHP 4.x and 5.x versions of PHP have a bug where the libjpeg is detected but
not enabled during the ./configure step; this is fairly prevalent on Red
Hat/RHEL/CentOS systems. The fix for this (if you don't want to use ImageMagick) is
to recompile PHP. First, find out (from phpinfo()) what the existing ./configure
switches were, and add --with-jpeg-dir before --with-gd.

make clean
./configure --with-various-switches --with-jpeg-dir --with-gd --with-more-switches
make
make test
#switch to root
make install
Afterwards, restart the webserver (for Apache on Red Hat: service apache stop then
service apache start ). To test, simply view the File:... page again (no need to
upload again). For more information see the comments on PHP: imagecreatefromjpeg
(function synopsis)

Unable to save thumbnail to destination


If you get the error "Error generating thumbnail / Error creating thumbnail: Unable
to save thumbnail to destination" and the $wgUploadDirectory directory has the
correct permissions, check that $wgTmpDirectory actually exists. (Unlike some path
variables such as $wgCacheDirectory, $wgTmpDirectory is not created at runtime.)

Manually adding thumbnail files


In situations in which it's not feasible to create the thumbnails dynamically on
request (e.g. for very large images, "Error creating thumbnail: unable to extend
cache" and similar), it is possible to manually add the thumbnail files. This
involves creating the smaller images in the desired sizes and uploading them to the
thumb/ directory in $wgUploadDirectory.

For example, a file that has uploaded to:

images/f/f8/Foo.png
should have its thumbnails at:

images/thumb/f/f8/Foo.png/100px-Foo.png
images/thumb/f/f8/Foo.png/600px-Foo.png
The pixel size is the horizontal dimension. An example Bash script for creating
thumbnails is available at Phabricator:P7049.
Sorry! We could not process your edit due to a loss of session data. Please try
again. If it still doesn't work, try logging out and logging back in.
See Manual:How to debug/Login problems.

Content Limits
If your Apache server has the Hardened PHP patch, you may need to edit several
variables in your /etc/php.ini file if you wish to have wiki pages with large
amounts of content. In particular, consider the settings for
varfilter.max_value_length, hphp.post.max_value_length, and
hphp.request.max_value_length. The default settings may limit your pages to less
than 10k or 64k in size.

Another possibility is if your Apache server is using mod_security that could be


interfering with mediawiki. You will need to turn it off for mediawiki to work
properly

You might also like