mp4 file has wrong icon

Bug #1220639 reported by Kristina Hoeppner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Robert Lyon

Bug Description

On master (1.8.0dev) in Firefox:

When an mp4 file is uploaded, it does not have the media icon of a camera, but just the generic document icon. I think the match-up of mime type and icon doesn't work properly.

Revision history for this message
Robert Lyon (robertl-9) wrote :

I've done tests in .avi .flv and .mp4 files in 1.5, 1.6, 1.7 and 1.8 and all those files get 'file' icon in each version on Mahara.

So this is an existing bug.

Robert Lyon (robertl-9)
Changed in mahara:
status: Triaged → In Progress
Revision history for this message
Aaron Wells (u-aaronw) wrote :

I wonder if they *never* worked in FF, or if this is the result of a recent change in the browser?

Revision history for this message
Aaron Wells (u-aaronw) wrote :

For what it's worth, I've got a .m4a file that I uploaded to mahara.org on July 7, which has the generic file icon.

I guess we could check whether this has ever worked, by looking in the database for one of our production sites and seeing if there are any files that are stored with a mime-type of movie or whatever brings up the camera icon.

Revision history for this message
Robert Lyon (robertl-9) wrote :
Revision history for this message
Robert Lyon (robertl-9) wrote :

The problem was the audio and video filetypes were not actually checking properly for their filetype - it was checking on the fall back guess option but not the filetype given to it from the uploaded file

Revision history for this message
Robert Lyon (robertl-9) wrote :

The patch I made should be checking for (at least) these mime types for video and giving them a video icon on upload.

    [video/x-msvideo] => stdClass Object
        (
            [description] => avi
            [mimetype] => video/x-msvideo
        )

    [video/quicktime] => stdClass Object
        (
            [description] => quicktime
            [mimetype] => video/quicktime
        )

    [video/x-sgi-movie] => stdClass Object
        (
            [description] => sgi_movie
            [mimetype] => video/x-sgi-movie
        )

    [video/mpeg] => stdClass Object
        (
            [description] => mpeg
            [mimetype] => video/mpeg
        )

    [video/mp4] => stdClass Object
        (
            [description] => mp4_video
            [mimetype] => video/mp4
        )

    [video/x-ms-wmv] => stdClass Object
        (
            [description] => wmv
            [mimetype] => video/x-ms-wmv
        )

    [application/x-flash-video] => stdClass Object
        (
            [description] => flv
            [mimetype] => application/x-flash-video
        )

    [video/flv] => stdClass Object
        (
            [description] => flv
            [mimetype] => video/flv
        )

    [video/x-flv] => stdClass Object
        (
            [description] => flv
            [mimetype] => video/x-flv
        )

Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

Mhh. I'll send you the wmv file that I'm using.

Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

Ah. Might be a problem with the file. I found another wmv file and that is identified correctly.

Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

Bob could upload the file that failed for me just fine.

Revision history for this message
Robert Lyon (robertl-9) wrote :

Ok - the problem here is not fixed by my patch (just avoided). The problem looks to be in file_mime_type() function

The function relies on finfo(), which has problems with the /usr/share/misc/magic.mgc file. The file is not working correctly for the version of PHP that some are using - see: https://bugs.php.net/bug.php?id=61940#1336148541

Or it relies on mime_content_type() which is deprecated.

So the question is now that it really only relies on finfo() how are we going to deal with the magic.mgc file being incorrect for some?

Can we include the needed magic.mgc files that work like mentioned in the above link? Will that be allowed? will it cause headaches? is there an alternate way to check mimetypes?

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/2474
Committed: http://gitorious.org/mahara/mahara/commit/f38e001edb858e7fe4cfe1d058134a785a425258
Submitter: Aaron Wells (<email address hidden>)
Branch: master

commit f38e001edb858e7fe4cfe1d058134a785a425258
Author: Robert Lyon <email address hidden>
Date: Thu Sep 5 08:44:08 2013 +1200

Correct icons now showing up for audio and video files (Bug #1220639)

- when uploading a video or audio file in Content -> files the icon
associated with it was the generic 'file' icon. now it should be the
correct video or audio icon.

Change-Id: If009baaa9f7925eeec27d5fdb31b57cbb30216ff

Changed in mahara:
status: In Progress → Fix Committed
Aaron Wells (u-aaronw)
Changed in mahara:
milestone: 1.8rc1 → 1.8.0
Aaron Wells (u-aaronw)
Changed in mahara:
status: Fix Committed → Fix Released
Revision history for this message
Aaron Wells (u-aaronw) wrote :

See also https://bugs.launchpad.net/mahara/+bug/1249858 about the greater mimetypes issue

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.