[Mediawiki-l] MimeMagic detects image/png as text/plain

Sebastian Raible sebastian at raible.org
Tue Feb 20 09:14:47 UTC 2007


Dear list,


a quick search through the list archives didn't bring up a result so
please excuse me if this issue has been solved already.

I am currently using Mediawiki 1.9.2. and experienced problems uploading
PNG images.

Although my test image shows an 'image/png'-mimetype with 'file -i',
Mediawiki keeps saying the file was corrupted.

Monitoring /tmp/php* while uploading the image again shows the uploaded
file to be image/png, too:
	while(usleep 1); do file -i /tmp/php*|grep -v "ERROR"; done
	/tmp/phpksjpPO: image/png

Mediawiki debug says
	MimeMagic::detectMimeType: magic mime type of /tmp/phpcDoKKE:
	text/plain
amongst other things, so I guess MimeMagic isn't working correctly..
Searching the meta wiki gives me the hint to add
	$wgMimeDetectorCommand  = "/usr/bin/file -bi";
to LocalSettings.php as a workaround, which actually does the trick.

But still I wonder: What's the problem with MimeMagic?


Thanks,
Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.wikimedia.org/pipermail/mediawiki-l/attachments/20070220/ae15d55e/attachment.pgp 


More information about the MediaWiki-l mailing list