Last modified: 2011-03-13 18:05:16 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 4188 - *.ico files could be uploaded (after patching) but are not rendered inline and not thumbnailed (solution needed)
*.ico files could be uploaded (after patching) but are not rendered inline an...
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
All All
: Lowest normal (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
  Show dependency treegraph
Reported: 2005-12-05 23:49 UTC by T. Gries
Modified: 2011-03-13 18:05 UTC (History)
0 users

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


Description T. Gries 2005-12-05 23:49:30 UTC
I wanted to create a small image gallery aka 'favicons'.

I found two problems, the first one while uploading

WebRequest::getFileName() 'myfavicon.ico' normalized to 'myfavicon.ico'
Block::load: '', '1', 1
MimeMagic::MimeMagic: loading mime types from includes/mime.types
MimeMagic::MimeMagic: loading mime info from includes/
MimeMagic::detectMimeType: no magic mime detector found!
MimeMagic::detectMimeType: image mime type of /tmp/php7eycaa: image/vnd.wap.wbmp
MimeMagic::guessMimeType: final mime type of /tmp/php7eycaa: image/vnd.wap.wbmp
SpecialUpload::verifyExtension: mime type image/vnd.wap.wbmp mismatches file
extension ico, rejecting file

Solution:  add in the file /includes/mime.types the line
  image/vnd.wap.wbmp ico

Remark: this type was shown in the debug log for several files of different
origin when uploading with Netscape 7.1

and add in /includes/DefaultSettings.php the file extension to the existing array
  $wgFileExtensions = array(......,  'ico' )

This allows to upload an *.ico file.

However, the image page is not showing the thumbnail, perhaps because the
thumbnail routines cannot render this. But also [[image:myfavicon.ico]] does not
work, i.e. does not render the image (needs to be fixed). 

Both problems need review of experts of the /include/Image.php module.
Comment 1 Brion Vibber 2005-12-05 23:53:47 UTC
Most browsers don't support Windows icon files.
Comment 2 Daniel Kinzler 2005-12-06 00:04:14 UTC
First of all, with "image/vnd.wap.wbmp ico" you told mediawiki that windows bmp
files are icon files - that's simply wrong. Get your mime detection to work -
under linux, you can set $wgMimeDetectorCommand= "file -bi", that should do it.
Alternatively, get a version of PHP that has either the fileinfo or the
mime_magic extension compiled in. ico files should be tectected as image/x-icon.

Second, ico-files will not be handeled as images by mediawiki, because many
browsers do not support it, and it can't really be scaled. It could be rendered
server-side using imagemagick in theory, but this is suppressed, because ico
files may contain multiple images (for animations, or different ones for
enabled/disabled, etc), and the software can't know which one to use. You can
hack that locally, if you want, by uncommenting the following line in the
canRender function in Image.php: 

 #|| $mime === 'image/x-icon'   #file may be split into multiple parts

Comment 3 Brion Vibber 2005-12-06 00:26:37 UTC
Note that wbmp isn't Windows Bitmap, it's some other format for use with WAP.
Comment 4 T. Gries 2005-12-06 00:39:38 UTC
The tip with  $wgMimeDetectorCommand= "file -bi" was perfect (I overlooked that
for weeks) !

But now a request for small code cosmetics in CVS HEAD:

Add in DefaultSettings.php in that line 266 a semicolon after -bi"

265 $wgMimeDetectorCommand= NULL; # use internal mime_content_type function,
available since php 4.3.0
266 #$wgMimeDetectorCommand= "file -bi" #use external mime detector (linux)

266 #$wgMimeDetectorCommand= "file -bi"; #use external mime detector (linux)
Comment 5 Rowan Collins [IMSoP] 2005-12-06 00:52:30 UTC
(In reply to comment #4)
> Add in DefaultSettings.php in that line 266 a semicolon after -bi"

Comment 6 T. Gries 2005-12-06 00:57:13 UTC
Hope, that it's okay when I now wontfix this bugzilla.

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