https://bugzilla.wikimedia.org/show_bug.cgi?id=54105
Web browser: --- Bug ID: 54105 Summary: image upload fails with complaint about it being a "corrupt or otherwise unreadable ZIP file." Product: MediaWiki Version: 1.21.1 Hardware: All OS: All Status: UNCONFIRMED Severity: major Priority: Unprioritized Component: Uploading Assignee: wikibugs-l@lists.wikimedia.org Reporter: cl...@snoopycat.ca CC: bawolff...@gmail.com, bryan.tongm...@gmail.com, fflo...@wikimedia.org, mtrac...@member.fsf.org Classification: Unclassified Mobile Platform: --- Attempting to upload a specific gif file always fails with the error mentioned in the summary. Steps to reproduce: 1. Download the image http://images.kingdomofloathing.com/itemimages/snakes/12bl.gif 2. Upload file to mediawiki (versions 1.20.2 and 1.21.1 tried) Results: Error displayed: "The file is a corrupt or otherwise unreadable ZIP file. It cannot be properly checked for security." Image is not uploaded. Source filename field reverts to no image selected. Expected Results: Image should be uploaded, with no errors given. Notes: I don't see anything wrong with the image---it's a regular (small) gif image, and not a zip file. There are many other gif images on the site, so it is not a problem with gif files in general, it is specific to this particular file. The message is the textual form of the "zip-bad" error, which is returned by ZipDirectoryReader in a few places. I turned on debug logging, and found the full failure flow: ----------- MimeMagic::__construct: loading mime types from /var/www/wiki/includes/mime.types MimeMagic::__construct: loading mime info from /var/www/wiki/includes/mime.info MimeMagic::doGuessMimeType: analyzing head and tail of /tmp/phpWYS1lh for magic numbers. MimeMagic::doGuessMimeType: getimagesize detected /tmp/phpWYS1lh as image/gif MimeMagic::guessMimeType: guessed mime type of /tmp/phpWYS1lh: image/gif MimeMagic::improveTypeFromExtension: improved mime type for .gif: image/gif FSFile::getProps: /tmp/phpWYS1lh loaded, 1851 bytes, image/gif. mime: <image/gif> extension: <gif> UploadBase::detectScript: checking for embedded scripts and HTML stuff UploadBase::detectScript: no scripts found ZipDirectoryReader: Fatal error: trailing bytes after the end of the file comment ----------- ZipDirectoryReader's complaint is likely true...but only because it is not a zip file. Just to be sure I attempted to unzip the file, and only got errors as expected: ----------- caution: zipfile comment truncated warning [12bl.gif]: zipfile claims to be last disk of a multi-part archive; attempting to process anyway, assuming all parts have been concatenated together in order. Expect "errors" and warnings...true multi-part support doesn't exist yet (coming soon). error [12bl.gif]: missing 6459880350 bytes in zipfile (attempting to process anyway) error [12bl.gif]: attempt to seek before beginning of zipfile (please check that you have transferred or created the zipfile in the appropriate BINARY mode and that you have compiled UnZip properly) ----------- Loading the image into gimp, doing a dummy-edit and resaving it without a comment or with a different comment does not help. -- You are receiving this mail because: You are the assignee for the bug. You are on the CC list for the bug. _______________________________________________ Wikibugs-l mailing list Wikibugs-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikibugs-l