Proper handling of ".ogg" files
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
Medium
|
Son Nguyen |
Bug Description
Son has found that Mahara doesn't currently handle ".ogg" files correctly. We have separate mappings for ".ogv" and ".oga" in the artefact_
So, this gets passed to finfo->file() or mime_content_
This puts us in a bind, because none of our available methods (file suffix, finfo, or mime_content_type) can determine whether these files are audio or video. The command-line Unix utility "mimetype" *can* distinguish them, but it's preferable not to bring more command-line utility execution into Mahara because it hurts portability.
Fortunately, there's an easy way out. According to Wikipedia, the ".ogg" suffix was used for both OGG video & OGG audio prior to 2007. After that, the Xiph foundation changed their recommendation so that ".ogg" should be used only for audio files. (See https:/
So, we should fix this issue as follows:
1. As an immediate fix, put a mapping in artefact_
2. As a longer-term fix, see if there are any all-PHP techniques (or maybe Javascript techniques we could use at the upgrade step?) to distinguish ogg/audio and ogg/video files based on their file content. (i.e., has anyone ported the "mimetype" utility to PHP?)
Changed in mahara: | |
assignee: | nobody → Son Nguyen (ngson2000) |
status: | Confirmed → In Progress |
Changed in mahara: | |
status: | In Progress → Fix Committed |
tags: | added: nominatedfeature |
Changed in mahara: | |
status: | Fix Committed → Fix Released |
There is a problem of adding a mapping in artefact_ file_mime_ types table as the map audio/ogg -> oga existed and the column 'mimetype' is an primary key.
I'd remove this constraint as a mimetype can have several description.