Last modified: 2011-06-24 17:03:44 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 T20803, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 18803 - JPEG2000 images should not be uploadable as .jpg files
JPEG2000 images should not be uploadable as .jpg files
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Uploading (Other open bugs)
unspecified
All All
: Low enhancement with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
http://commons.wikimedia.org/wiki/Ima...
: patch, patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-05-15 00:13 UTC by Brion Vibber
Modified: 2011-06-24 17:03 UTC (History)
6 users (show)

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


Attachments
proposed patch (923 bytes, patch)
2009-05-15 19:30 UTC, Ahmad Sherif
Details

Description Brion Vibber 2009-05-15 00:13:37 UTC
Rolling this out of bug 11871, which was asking for _support_ for JPEG 2000 images. Since they're not widely supported by browsers and they're a lossy format without a clear benefit to use I'm WONTFIXing that for now, but the upload bug that makes it possible to mistakenly upload them remains.

http://commons.wikimedia.org/wiki/Image:VIC_2_SECTION_%28Converted%29-1.jpg
is an example of a file that was first uploaded as JPEG 2000 (the current version was correctly converted to regular JPEG).

http://test.wikipedia.org/wiki/File:A_JPEG_2000_file.jpg
is an example mentioned also on the previous bug which I reuploaded to test to confirm the bug is still present.

File file type is being detected as image/jp2, but this shouldn't make it past upload since it shouldn't match '.jpg' file extension...
Comment 1 Tisza Gergő 2009-05-15 15:47:17 UTC
Probably a more general bug, for example [[hu:File:China.ogg]] is an mp3 file with .ogg extension.
Comment 2 Ahmad Sherif 2009-05-15 19:30:30 UTC
Created attachment 6123 [details]
proposed patch

(In reply to comment #0)
> File file type is being detected as image/jp2, but this shouldn't make it past
> upload since it shouldn't match '.jpg' file extension...
> 

I think this is because there is no mime type entry for jpeg2000 format in mime.types file. I made a patch anyway.

(In reply to comment #1)
> Probably a more general bug, for example [[hu:File:China.ogg]] is an mp3 file
> with .ogg extension.
> 

IMHO, this is because 'audio/mp3' is the main mime type in mime.info and we use 'audio/mpeg' in mime.types instead of it, so MimeMagic::isMatchingExtension() returns NULL (which means continue) instead of false. It only needs a switch in one of the files.
Comment 3 Brion Vibber 2009-05-15 21:20:56 UTC
That should mean you can never upload those files at all, if they're unrecognized they can't match the known extension type...
Comment 4 Bryan Tong Minh 2011-05-14 14:42:30 UTC
Added the entries to mime.types and mime.info in r88086.

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


Navigation
Links