Jump to content

Topic on Project:Support desk

Error in the creation of thumbnails.

14
31.163.98.216 (talkcontribs)

Good day. I have a error in the creation of a thumbnail image, when added to the site a file of the drawings. And constantly writes the error of this type: "Error creating thumbnail. You cannot save the sketch to the place of destination" Address of my site - http://hogsholla.ru/wiki/index.php Version of MediaWiki 1.20.0

Bawolff (talkcontribs)

Sounds like a permission problem. Make sure that MediaWiki has permission to save files and create new directories in the upload directory

31.163.87.8 (talkcontribs)
## To enable image uploads, make sure the 'images' directory
## is writable, then set this to true:
$wgEnableUploads  = true;
$wgUseImageResize  = true;
$wgUseImageMagick = true;
$wgImageMagickConvertCommand = "/usr/bin/convert";
$wgFileExtensions = array('png','gif','jpg','jpeg','doc','xls','mpp','pdf','ppt','tiff','bmp','docx', 'xlsx', 'pptx','ps','odt','ods','odp','odg');
PlastNEO (talkcontribs)

Hi! I have the same problem. ImageMagick seems to work, because I get "Version: ImageMagick 6.6.0-4 2012-05-02 Q16 http://www.imagemagick.org Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC Features: OpenMP" when i test it with -version command.

Also have such settings like mentioned. I have file permissions 777. What else could I do? File is uploaded, because i found archive/0/0c/20131107193636!Slimak1.png/ which was file I uploaded. Yet there are no thumbnails.

MarkAHershberger (talkcontribs)

Is your wiki public? Maybe we could see the problem if we looked.

Otherwise, does your error log show anything during or after the upload?

46.187.188.208 (talkcontribs)

It is yet not public, but maybe log will give a hint what is matter.

MarkAHershberger (talkcontribs)

Is this debug log the result from when you're uploading a file and the file exists on disk, but no thumbnail shows?

Maybe the problem is your temporary directory.

46.187.188.208 (talkcontribs)

my investigation showed, that file i send is uploaded to archives, not the temp. In temp directory i found the same (big size) file I tried to upload but no thumbnails. The folder also have 777 permissions. What else could be wrong with it? But, why does the files have to be scaled by some software? Couldnt it be simply scaled like in normal html/php? Is there any alternate solution to add an scaled image to article without creating thumbnails?

Bawolff (talkcontribs)

Your file system temp directory is different than the temp directory that is a subdirectory of the mediawiki images directory. Thumbnails get generated in the system temp directory first, and then moved to the thumbs directory.

The debug log you posted is consistent with your temp directory not being writable by mediawiki (It determines it needs to make the thumbnail, it does stat calls, determine that thumb does not exist, bails before trying to render the file. The two causes of that that I am aware of is either temp directory unwritable, or filerepo is configured to be read only. The latter is not something that can really happen by accident).

Specificly, the following part:

File::transform: Doing stat for mwstore://local-backend/local-thumb/0/0c/Slimak1.png/120px-Slimak1.png
FileBackendStore::getFileStat: File mwstore://local-backend/local-thumb/0/0c/Slimak1.png/120px-Slimak1.png does not exist.
File::transform: Doing stat for mwstore://local-backend/local-thumb/archive/0/0c/20131108161614!Slimak1.png/120px-Slimak1.png

Indicates mediawiki knows it needs to create a thumbnail, but gave up before trying to do so, and moved on to the next thumbnail it needed. If it actually got further than the is temp directory writable step, there would be stuff about rendering the thumbnails between the stat related debug lines.


tl;dr Set $wgTmpDirectory to somewhere writable by the webserver. (Ideally somewhere not web accessible, but probably not the end of the world if it is).


It is possible to disable thumbnailing, and use browser scaling. You can do this by setting $wgUseImageResize = false;. I don't really know anyone who does this, so not sure how well it works. I would recommend trying to get the temp directory to work first, and disable scaling as a last resort.

46.187.188.208 (talkcontribs)

I set the absolute path to tmp dir of my wiki. Still no thumbnails, but error changed to simply saying there was error in generating thumbnail, not "Error creating thumbnail. You cannot save the sketch to the place of destination" . Also log changed, so maybe answer is there. Thank You for Your help.

MarkAHershberger (talkcontribs)

It looks like it is doing something different this time, at least. But I see errors like the following:

[exec] Possibly missing executable file: /bin/bash ...
BitmapHandler::getMagickVersion: ImageMagick version check failed
BitmapHandler::transformImageMagick: running ImageMagick: '/usr/local/bin/convert' ...
wfShellExec: /bin/bash ...
[exec] Possibly missing executable file: ...'\''/usr/local/bin/convert'\''...
[thumbnail] thumbnail failed on gamma: error 127 "" from "'/usr/local/bin/convert' ...
[thumbnail] Removing bad 0-byte thumbnail "...". unlink() succeeded

Is ImageMagick installed? Is there a /usr/local/bin/convert?

Soumya.sadanandan (talkcontribs)

1. Ensure that 755 permission is there on images folder 2. Ensure that Image Magick is installed (Use command " locate imagemagick" to locate and "convert -version" to find the version of Image Magick) 3. Localsettings.php variable "$wgImageMagickConvertCommand =" points to the correct Image Magick path, say "ImageMagick/bin/convert".

Mattes1002 (talkcontribs)

Hi! The command: "locate imagemagic"

$ locate imagemagick
/usr/share/bug/imagemagick-6-common
/usr/share/bug/imagemagick-6-common/presubj
/usr/share/bug/imagemagick-6-common/script
/usr/share/doc/imagemagick-6-common
/usr/share/doc/imagemagick-6-common/NEWS.Debian.gz
/usr/share/doc/imagemagick-6-common/README.Debian
/usr/share/doc/imagemagick-6-common/README.txt.gz
/usr/share/doc/imagemagick-6-common/TODO.Debian
/usr/share/doc/imagemagick-6-common/changelog.Debian.gz
/usr/share/doc/imagemagick-6-common/copyright
/usr/share/doc/imagemagick-6-common/html
/usr/share/doc/imagemagick-6-common/html/README
/var/lib/dpkg/info/imagemagick-6-common.conffiles
/var/lib/dpkg/info/imagemagick-6-common.list
/var/lib/dpkg/info/imagemagick-6-common.md5sums

The command: "convert -version" after I installed:

sudo apt install imagemagick-6.q16
sudo apt install graphicsmagick-imagemagick-compat
sudo apt install imagemagick-6.q16hdri
$ convert -version

Version: ImageMagick 6.9.7-4 Q16 x86_64 20170114 http://www.imagemagick.org

Copyright: © 1999-2017 ImageMagick Studio LLC

License: http://www.imagemagick.org/script/license.php

Features: Cipher DPC HDRI Modules OpenMP

Delegates (built-in): bzlib djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png tiff wmf x xml zlib

Got a Ubuntu 18...

But there is no path "/usr/bin/convert"

So what do I need to do to get this imagemagick to work?

Thanks!

Ciencia Al Poder (talkcontribs)

To get the path to the convert command, run:

which convert
Reply to "Error in the creation of thumbnails."