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
Topic on Project:Support desk
Sounds like a permission problem. Make sure that MediaWiki has permission to save files and create new directories in the upload directory
## 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');
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.
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?
It is yet not public, but maybe log will give a hint what is matter.
debug log |
---|
Start request GET /PlastWiki/index.php/Plik:Slimak1.png
HTTP HEADERS:
HOST: plastneo.pl
CONNECTION: keep-alive
CACHE-CONTROL: max-age=0
AUTHORIZATION: Basic cGxhc3RuZW86dGVtcFdlYmhvbWUzMjE=
ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
USER-AGENT: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.66 Safari/537.36
REFERER: http://plastneo.pl/PlastWiki/index.php?title=Specjalna:Prze%C5%9Blij&wpDestFile=Slimak1.png&wpForReUpload=1
ACCEPT-ENCODING: gzip,deflate,sdch
ACCEPT-LANGUAGE: pl-PL,pl;q=0.8,en-US;q=0.6,en;q=0.4
COOKIE: cookie=1; wikiEditor-0-toolbar-section=help; wikiEditor-0-booklet-help-page=link; PHPSESSID=aecef8b8f3a04a7f59ed7e5e1cacfc8e; wikidb_plastneoUserID=1; wikidb_plastneoUserName=Wikisu; wikidb_plastneo_session=29c3249c756979669809e53c9cc85981; vector-nav-p-tb=true
CACHES: EmptyBagOStuff[main] SqlBagOStuff[message] SqlBagOStuff[parser]
LocalisationCache: using store LCStore_DB
Unstubbing $wgParser on call of $wgParser::setHook from wfEmailFormExtension
Parser: using preprocessor: Preprocessor_DOM
Fully initialised
Profiler::instance called without $wgProfiler['class'] set, falling back to ProfilerStub for safety
Connected to database 0 at mysql5.nq.pl
Title::getRestrictionTypes: applicable restrictions to [[Plik:Slimak1.png]] are {edit,move,upload}
User: cache miss for user 1
User: loading options for user 1 from database.
User: logged in from session
User: loading options for user 1 from override cache.
RepoGroup::findFile: got File:Slimak1.png from process cache
Unstubbing $wgLang on call of $wgLang::getCode from MessageCache::get
Connected to database 0 at mysql5.nq.pl
MessageCache::load: Loading pl... got from global cache
MimeMagic::__construct: loading mime types from /alt/home/webmaster.plastneo/html/PlastWiki/includes/mime.types
MimeMagic::__construct: loading mime info from /alt/home/webmaster.plastneo/html/PlastWiki/includes/mime.info
File::transform: Doing stat for mwstore://local-backend/local-thumb/0/0c/Slimak1.png/543px-Slimak1.png
FileBackendStore::getFileStat: File mwstore://local-backend/local-thumb/0/0c/Slimak1.png/543px-Slimak1.png does not exist.
RepoGroup::findFile: got File:Slimak1.png from process cache
RepoGroup::findFile: got File:Slimak1.png from process cache
Article::view using parser cache: yes
Parser options key expired, touched 20131108161615, epoch 20131107201400, cached 20131108161556
Article::view: doing uncached parse
Parser cache options found.
Saved in parser cache with key wikidb_plastneo:pcache:idhash:64-0!*!*!*!*!*!* and timestamp 20131108161615
DatabaseBase::query: Writes done: REPLACE INTO `objectcache` (keyname,value,exptime) VALUES ('wikidb_plastneo:pcache:idhash:64-0!*!*!*!*!*!*','uT]o�0��s~���ItI�(5Ӥ�u���$��8��.X$�e;-�����߸_2�@�$��C�=�^����s\Z\'4\\0c��K�K��n�>Xڧa����G�v�C\Z���;�����bArQ�G�he\\��_�R�V�r\'�p��T�H�J�(���Q�4��H0�MN^�ʺ��N3ɉ�i^z����K&��e�O�z���+(t�k�f��\0���MD���HU�\n% ��6H�E��N������HȯR��Yu%A��18�c��\0[{��,�\0��nC���?����ά����p*���\r��:������L\'\n��+4I�����0���O�Oq�q�o��ɬd�������ш><z,��؏!SF@��p������x����-]�]�m|�e���VoU�����ǓZ|�kȥ��������*�����L��k�k�G]�;�F�����q*=��}M�����U��5�Fǜ���\n��n�W��`������:(j�����e��n��ej�vu����}3�����!hM��y8������<���)d֊����|ͅ;B+����4����0J�q\r�`�j>��f7h�?�p�웣%���t&F�o���5r���a�P�H�������)��\0��#����פ$gf��9�M��!��I�\Z�:���T����LQ]v�����,y���u�-��V����@��b��?V�1!�<�3�������','20131109161615')
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
FileBackendStore::getFileStat: File mwstore://local-backend/local-thumb/archive/0/0c/20131108161614!Slimak1.png/120px-Slimak1.png does not exist.
File::transform: Doing stat for mwstore://local-backend/local-thumb/archive/0/0c/20131107193636!Slimak1.png/120px-Slimak1.png
FileBackendStore::getFileStat: File mwstore://local-backend/local-thumb/archive/0/0c/20131107193636!Slimak1.png/120px-Slimak1.png does not exist.
User::getBlockedStatus: checking...
ForeignAPIRepo: HTTP GET: http://commons.wikimedia.org/w/api.php?aisha1base36=h81gzutrhlh1lkvnxh20x3l2v92g6uo&aiprop=timestamp%7Cuser%7Ccomment%7Curl%7Csize%7Csha1%7Cmetadata%7Cmime&list=allimages&format=json&action=query&redirects=true
Class PEAR_Error not found; skipped loading
RepoGroup::findFile: got File:Slimak1.png from process cache
RepoGroup::findFile: got File:Slimak1.png from process cache
Title::getRestrictionTypes: applicable restrictions to [[Plik:Slimak1.png]] are {edit,move,upload}
Title::getRestrictionTypes: applicable restrictions to [[Plik:Slimak1.png]] are {edit,move,upload}
Title::getRestrictionTypes: applicable restrictions to [[Plik:Slimak1.png]] are {edit,move,upload}
|
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.
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?
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.
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.
debug log |
---|
Start request GET /PlastWiki/index.php/Plik:Test3.jpg
HTTP HEADERS:
HOST: plastneo.pl
CONNECTION: keep-alive
CACHE-CONTROL: max-age=0
AUTHORIZATION: Basic cGxhc3RuZW86dGVtcFdlYmhvbWUzMjE=
ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
USER-AGENT: Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.6 Safari/537.36
REFERER: http://plastneo.pl/PlastWiki/index.php/Specjalna:Prze%C5%9Blij
ACCEPT-ENCODING: gzip,deflate,sdch
ACCEPT-LANGUAGE: pl-PL,pl;q=0.8,en-US;q=0.6,en;q=0.4
COOKIE: PHPSESSID=364a8e01db7c40278d52fb132087c64b; cookie=1; mw_installer_session=79b8186c49e1464aee36d6e83ed3b269; wikidb_plastneoUserID=1; wikidb_plastneoUserName=Wikisu; wikidb_plastneo_session=1dc8620186c6602c0eebc064249872ff
CACHES: EmptyBagOStuff[main] SqlBagOStuff[message] SqlBagOStuff[parser]
[cookie] session_set_cookie_params: "0", "/", "", "", "1"
LocalisationCache: using store LCStore_DB
Unstubbing $wgParser on call of $wgParser::setHook from wfEmailFormExtension
Parser: using preprocessor: Preprocessor_DOM
Fully initialised
Profiler::instance called without $wgProfiler['class'] set, falling back to ProfilerStub for safety
Connected to database 0 at mysql5.nq.pl
Title::getRestrictionTypes: applicable restrictions to [[Plik:Test3.jpg]] are {edit,move,upload}
[ContentHandler] Created handler for wikitext: WikitextContentHandler
User: cache miss for user 1
User: loading options for user 1 from database.
User: logged in from session
User: loading options for user 1 from override cache.
RepoGroup::findFile: got File:Test3.jpg from process cache
Unstubbing $wgLang on call of $wgLang::getCode from MessageCache::get
Connected to database 0 at mysql5.nq.pl
MessageCache::load: Loading pl... got from global cache
MimeMagic::__construct: loading mime types from /alt/home/webmaster.plastneo/html/PlastWiki/includes/mime.types
MimeMagic::__construct: loading mime info from /alt/home/webmaster.plastneo/html/PlastWiki/includes/mime.info
File::transform: Doing stat for mwstore://local-backend/local-thumb/1/19/Test3.jpg/640px-Test3.jpg
FileBackendStore::getFileStat: File mwstore://local-backend/local-thumb/1/19/Test3.jpg/640px-Test3.jpg does not exist.
BitmapHandler::doTransform: creating 640x480 thumbnail at /alt/home/webmaster.plastneo/html/PlastWiki/tmp/transform_6a141a667389-1.jpg using scaler im
BitmapHandler::doTransform: returning unscaled image
RepoGroup::findFile: got File:Test3.jpg from process cache
RepoGroup::findFile: got File:Test3.jpg from process cache
Article::view using parser cache: yes
Parser cache options found.
ParserOutput cache found.
Article::view: showing parser cache contents
File::transform: Doing stat for mwstore://local-backend/local-thumb/1/19/Test3.jpg/120px-Test3.jpg
FileBackendStore::getFileStat: File mwstore://local-backend/local-thumb/1/19/Test3.jpg/120px-Test3.jpg does not exist.
BitmapHandler::doTransform: creating 120x90 thumbnail at /alt/home/webmaster.plastneo/html/PlastWiki/tmp/transform_4ae2a9f1dfa6-1.jpg using scaler im
BitmapHandler::doTransform: called wfMkdirParents(/alt/home/webmaster.plastneo/html/PlastWiki/tmp)
BitmapHandler::getMagickVersion: Running convert -version
wfShellExec: /bin/bash '/alt/home/webmaster.plastneo/html/PlastWiki/includes/limit.sh' ''\''/usr/local/bin/convert'\'' -version' 'MW_CPU_LIMIT=180; MW_CGROUP='\'''\''; MW_MEM_LIMIT=102400; MW_FILE_SIZE_LIMIT=102400; MW_WALL_CLOCK_LIMIT=180'
[exec] Possibly missing executable file: /bin/bash '/alt/home/webmaster.plastneo/html/PlastWiki/includes/limit.sh' ''\''/usr/local/bin/convert'\'' -version' 'MW_CPU_LIMIT=180; MW_CGROUP='\'''\''; MW_MEM_LIMIT=102400; MW_FILE_SIZE_LIMIT=102400; MW_WALL_CLOCK_LIMIT=180'
BitmapHandler::getMagickVersion: ImageMagick version check failed
BitmapHandler::transformImageMagick: running ImageMagick: '/usr/local/bin/convert' -quality 80 -background white '/alt/home/webmaster.plastneo/html/PlastWiki/images/1/19/Test3.jpg' -thumbnail '120x90!' -set comment 'File source: http://plastneo.pl/PlastWiki/index.php/Plik:Test3.jpg' -depth 8 -sharpen '0x0.4' -rotate -0 '/alt/home/webmaster.plastneo/html/PlastWiki/tmp/transform_4ae2a9f1dfa6-1.jpg' 2>&1
wfShellExec: /bin/bash '/alt/home/webmaster.plastneo/html/PlastWiki/includes/limit.sh' 'OMP_NUM_THREADS='\''1'\'' '\''/usr/local/bin/convert'\'' -quality 80 -background white '\''/alt/home/webmaster.plastneo/html/PlastWiki/images/1/19/Test3.jpg'\'' -thumbnail '\''120x90!'\'' -set comment '\''File source: http://plastneo.pl/PlastWiki/index.php/Plik:Test3.jpg'\'' -depth 8 -sharpen '\''0x0.4'\'' -rotate -0 '\''/alt/home/webmaster.plastneo/html/PlastWiki/tmp/transform_4ae2a9f1dfa6-1.jpg'\'' 2>&1' 'MW_CPU_LIMIT=180; MW_CGROUP='\'''\''; MW_MEM_LIMIT=102400; MW_FILE_SIZE_LIMIT=102400; MW_WALL_CLOCK_LIMIT=180'
[exec] Possibly missing executable file: /bin/bash '/alt/home/webmaster.plastneo/html/PlastWiki/includes/limit.sh' 'OMP_NUM_THREADS='\''1'\'' '\''/usr/local/bin/convert'\'' -quality 80 -background white '\''/alt/home/webmaster.plastneo/html/PlastWiki/images/1/19/Test3.jpg'\'' -thumbnail '\''120x90!'\'' -set comment '\''File source: http://plastneo.pl/PlastWiki/index.php/Plik:Test3.jpg'\'' -depth 8 -sharpen '\''0x0.4'\'' -rotate -0 '\''/alt/home/webmaster.plastneo/html/PlastWiki/tmp/transform_4ae2a9f1dfa6-1.jpg'\'' 2>&1' 'MW_CPU_LIMIT=180; MW_CGROUP='\'''\''; MW_MEM_LIMIT=102400; MW_FILE_SIZE_LIMIT=102400; MW_WALL_CLOCK_LIMIT=180'
[thumbnail] thumbnail failed on gamma: error 127 "" from "'/usr/local/bin/convert' -quality 80 -background white '/alt/home/webmaster.plastneo/html/PlastWiki/images/1/19/Test3.jpg' -thumbnail '120x90!' -set comment 'File source: http://plastneo.pl/PlastWiki/index.php/Plik:Test3.jpg' -depth 8 -sharpen '0x0.4' -rotate -0 '/alt/home/webmaster.plastneo/html/PlastWiki/tmp/transform_4ae2a9f1dfa6-1.jpg' 2>&1"
[thumbnail] Removing bad 0-byte thumbnail "/alt/home/webmaster.plastneo/html/PlastWiki/tmp/transform_4ae2a9f1dfa6-1.jpg". unlink() succeeded
User::getBlockedStatus: checking...
ForeignAPIRepo: HTTP GET: http://commons.wikimedia.org/w/api.php?aisha1base36=ol23mz6k5ntz00sp55cdta2y79mz30e&aiprop=timestamp%7Cuser%7Ccomment%7Curl%7Csize%7Csha1%7Cmetadata%7Cmime&list=allimages&format=json&action=query&redirects=true
Class PEAR_Error not found; skipped loading
RepoGroup::findFile: got File:Test3.jpg from process cache
RepoGroup::findFile: got File:Test3.jpg from process cache
Title::getRestrictionTypes: applicable restrictions to [[Plik:Test3.jpg]] are {edit,move,upload}
Title::getRestrictionTypes: applicable restrictions to [[Plik:Test3.jpg]] are {edit,move,upload}
Title::getRestrictionTypes: applicable restrictions to [[Plik:Test3.jpg]] are {edit,move,upload}
OutputPage::sendCacheControl: private caching; **
DatabaseBase::query: Writes done: UPDATE `page` SET page_counter = page_counter + 1 WHERE page_id = '75'
LoadBalancer::reuseConnection: this connection was not opened as a foreign connection
LoadBalancer::reuseConnection: this connection was not opened as a foreign connection
LoadBalancer::reuseConnection: this connection was not opened as a foreign connection
LoadBalancer::reuseConnection: this connection was not opened as a foreign connection
LoadBalancer::reuseConnection: this connection was not opened as a foreign connection
LoadBalancer::reuseConnection: this connection was not opened as a foreign connection
LoadBalancer::reuseConnection: this connection was not opened as a foreign connection
LoadBalancer::reuseConnection: this connection was not opened as a foreign connection
LoadBalancer::reuseConnection: this connection was not opened as a foreign connection
LoadBalancer::reuseConnection: this connection was not opened as a foreign connection
LoadBalancer::reuseConnection: this connection was not opened as a foreign connection
LoadBalancer::reuseConnection: this connection was not opened as a foreign connection
Request ended normally
wfClientAcceptsGzip: client accepts gzip.
wfGzipHandler() is compressing output
|
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
?
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".
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!
To get the path to the convert command, run:
which convert