crs4 / notredam

Automatically exported from code.google.com/p/notredam
http://www.notredam.org
17 stars 4 forks source link

Suggested supported_types changes #85

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I suggest some support_types changes. those are for the notredam-replacement 
branch. I don't know if those could be useful for the default branch.
I attached a hg bundle.
Do you prefer patches?

There's two change sets inside:

changeset:   2064:388a92bba00c
branch:      notredam-replacement
files:       src/dam/supported_types.py
description:
Moved '.mpg' extension as the first for video/mpeg as this is the most common 
extension.
Moved '.mpv' extension into the video/mpeg media type.
added video/quicktime media type for files with '.mov' extension.

changeset:   2063:387ee537fb04
branch:      notredam-replacement
files:       src/dam/supported_types.py
description:
Sort supported_types

Original issue reported on code.google.com by goo...@gmail.com on 10 Apr 2013 at 5:12

Attachments:

GoogleCodeExporter commented 9 years ago
If you download the original file from the summary/preview panel clicking on 
the diskette icon the first extension listed for that format in supported_types 
is the one used as the downloaded file extension.
As a results, for formats that have more that one extension in supported_types 
you have your extension replaced if your file extension is different from the 
first one.
Examples:
A matroska file has is '.mkv' extensino replaced with '.mpv'.
A MPEG file has is '.mpg' extension replaced with '.m1v'.

This is the reason of putting the most commonly used extension first and try to 
have formats that lists only one extension (video/quicktime -> .mov for 
example).

Of course the desired outcome could be to preserve the extension of the 
original uploaded file.
Could it be useful to use python-magic to detect file type regardless of its 
extension?

Original comment by goo...@gmail.com on 11 Apr 2013 at 9:37

GoogleCodeExporter commented 9 years ago
I have just applied your changesets to the NotreDAM repository.  Thank you!

Original comment by alce...@crs4.it on 18 Apr 2013 at 3:32