Last modified: 2010-05-15 15:50:55 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T4848, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 2848 - Thumbnails don't work
Thumbnails don't work
Status: RESOLVED WORKSFORME
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
1.10.x
PC Linux
: High major (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-07-13 18:39 UTC by Brad
Modified: 2010-05-15 15:50 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Brad 2005-07-13 18:39:41 UTC
None of the following lines display any image on my wiki page.  I've uploaded the image and can see 
it full size by saying [[Image:100_0170.JPG]].  But when using the "thumb" option, it will only 
display the image if the px number is at least as large as the original image.  Otherwise it 
doesn't show up and just displays a red X.  Is there anything I'm doing wrong?  Is this a bug?


[[Image:100_0170.JPG|thumb|none|191px|left|Sample thumbnail]]

[[Image:100_0170.JPG|191px|]]
Comment 1 Antoine "hashar" Musso (WMF) 2005-07-13 19:07:11 UTC
You want to enable image resizing in LocalSettings.php
 $wgUseImageResize       = true;

That should use GD for resizing. Eventually install imagemagick and add:
 $wgUseImageMagick = true;
 $wgImageMagickConvertCommand = "/usr/bin/convert";
Comment 2 Brad 2005-07-14 13:45:33 UTC
(In reply to comment #1)
> You want to enable image resizing in LocalSettings.php
>  $wgUseImageResize       = true;
> That should use GD for resizing. Eventually install imagemagick and add:
>  $wgUseImageMagick = true;
>  $wgImageMagickConvertCommand = "/usr/bin/convert";




Hey Ashar.  I installed ImageMagick and changed the approproate lines in LocalSettings.php to enable it.  But 
still have the same result.

I can see that the images are not being generated in the "images" subfolders.  As a result I see the following errors in the 
error log:

[Thu Jul 14 09:18:59 2005] [error] [client 132.224.125.91] File does not exist: C:/Program 
Files/TSW/Apache2/htdocs/mediawiki/images/thumb/a/ad/100_0170.JPG/191px-100_0170.JPG, referer: 
http://132.228.122.89/mediawiki/index.php/Brad%27s_Playground


My LocalSettings.php looks like this:

$wgEnableUploads		= true;
$wgUseImageResize		= true;
$wgUseImageMagick               = true;

$wgImageMagickConvertCommand = "C:\\Program Files\\imagemagick-6.2.3-q16\\convert.exe";
Comment 3 kpf 2008-01-17 10:26:03 UTC
I' ve modified the file includes/media/Bitmap.php. Now the thumbnailing works fine. Especially redirect from stderr output to stdoutput at the end of the command makes the command not working. The command tries to create a file "2>&1". Also the function wfEscapeShellArg() which escapes the $wgImageMagickConvertCommand, $srcPath and $dstPath makes the command not working. 

Below i've my solution for the problem. 

/*modified by kpf 16.01.2008*/
                        $cmd  =  $wgImageMagickConvertCommand .
                                " {$quality} -background white -size {$physicalWidth} ".
                                $srcPath .
                                // Coalesce is needed to scale animated GIFs properly (bug 1017).
                                ' -coalesce ' .
                                // For the -resize option a "!" is needed to force exact size,
                                // or ImageMagick may decide your ratio is wrong and slice off
                                // a pixel.
                                " -thumbnail " . wfEscapeShellArg( "{$physicalWidth}x{$physicalHeight}!" ) .
                                " -depth 8 $sharpen " .
                                $dstPath;

/*
                        $cmd  =  wfEscapeShellArg($wgImageMagickConvertCommand) .
                                " {$quality} -background white -size {$physicalWidth} ".
                                wfEscapeShellArg($srcPath) .
                                // Coalesce is needed to scale animated GIFs properly (bug 1017).
                                ' -coalesce ' .
                                // For the -resize option a "!" is needed to force exact size,
                                // or ImageMagick may decide your ratio is wrong and slice off
                                // a pixel.
                                " -thumbnail " . wfEscapeShellArg( "{$physicalWidth}x{$physicalHeight}!" ) .
                                " -depth 8 $sharpen " .
                                wfEscapeShellArg($dstPath)  " 2>&1";
/*end modified*/

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links