Topic on Project:Support desk

[RESOLVED] ImageMagick Thumbnail error: "no decode delegate"; "no data returned"

9
Dan-smith (talkcontribs)

I can't get ImageMagick to generate thumbnails. After a timeout (60 seconds or so), I get a grey box with the following error:

Error creating thumbnail: convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/532.
convert: no decode delegate for this image format `/var/tmp/magick-zeDREKz6' @ error/constitute.c/ReadImage/532.
convert: no data returned `http://[wiki URL]/index.php/File:Dan3.jpg' @ error/url.c/ReadURLImage/231.

If I turn off ImageMagick (commenting out "$wgUseImageMagick = true;") it works (via GD), but of course I want to be able to use ImageMagick.

I've confirmed that 'convert' works from the command line, and that $wgImageMagickConvertCommand points to the right place.

Something that would at least get me on the right path: is the root cause of the above error message "no decode delegate" or "no data returned"? Does ReadImage call ReadURLImage, or is it the other way around?

Versions: MediaWiki 1.16.5, PHP 5.3.4, MySQL 5.1.44, OS X 10.6.7, ImageMagick 6.6.9-10

This post was posted by Dan-smith, but signed as Smith.dan.

Dan-smith (talkcontribs)

I'm able to reproduce the error from the command line, though I'm still trying to understand it. Here's the invocation coming from MediaWiki:

convert -quality 80 -background white -size 120 /Library/WebServer/Documents/mediawiki-test/images/b/b0/Dan4.jpg -thumbnail 120x120! -set comment File source: http://''[wiki URL]/index.php/File:Dan4.jpg -depth 8 -sharpen 0x0.4 /Library/WebServer/Documents/mediawiki-test/images/thumb/b/b0/Dan4.jpg/120px-Dan4.jpg

Running this from the command line produces:

convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/532.
convert: no decode delegate for this image format `/var/tmp/magick-V5ijtHg1' @ error/constitute.c/ReadImage/532.
convert: no data returned `http://''[wiki URL]/index.php/File:Dan4.jpg' @ error/url.c/ReadURLImage/231.

If I replace the "-set comment ..." option with "-set comment xxx", it runs successfully:

sudo convert -quality 80 -background white -size 120 /Library/WebServer/Documents/mediawiki-test/images/b/b0/Dan4.jpg -thumbnail 120x120! -set comment xxx -depth 8 -sharpen 0x0.4 /Library/WebServer/Documents/mediawiki-test/images/thumb/b/b0/Dan4.jpg/120px-Dan4.jpg

It appears the thumbnail command is being interpreted as a request to load an image from the given URL.

Is this just a bug? Why is nobody else experiencing this?

This post was posted by Dan-smith, but signed as Smith.dan.

Dan-smith (talkcontribs)

Solved: my ImageMagick installation is hacked together, and there was a bug in the script located at /usr/local/bin/convert: it called convert $@ when it needed to call convert "$@". Hence, the free-form comment text wasn't escaped properly.

This post was posted by Dan-smith, but signed as Smith.dan.

Tobixen~mediawikiwiki (talkcontribs)

I have the same problem, but convert is a real binary and installed through standard apt-get on ubuntu. :/

This post was posted by Tobixen~mediawikiwiki, but signed as Tobixen.

2A02:C0:1002:102:9E8E:99FF:FED1:5218 (talkcontribs)

Issue resolved. The image directory wasn't mounted up. Rather confusing to get "no decode delegate" rather than "file not found" :-)

Nicolas NALLET (talkcontribs)

Hi, I got the same problem : see here

How did you fix it ?

Thanks,

209.119.132.238 (talkcontribs)

in LocalSettings.php

before all settings for ImageMagick - add this environment var. for thumbnails to work

putenv ('MAGICK_CODER_MODULE_PATH=C:\Bitnami\mediawiki-1.23.6-0\imagemagick\modules\coders');

Nicolas NALLET (talkcontribs)
111.206.82.147 (talkcontribs)

perfect