Ticket #2267 (new defect)

Opened 3 years ago

Last modified 3 years ago

Do we get the right file extension with mime.get_primary_extension(mime_type) ?

Reported by: erikos Owned by: tomeu
Priority: Unspecified by Maintainer Milestone: Unspecified by Release Team
Component: sugar Version: Git as of bugdate
Severity: Unspecified Keywords:
Cc: Distribution/OS: Unspecified
Bug Status: Unconfirmed

Description

I copied a photo taken with Record on a usb key. The file extension shown when inserting on another machine was .jpe Since I did not knew that extension I checked the Sugar code path. What we actually do is, we merge all the existing mime/globs in a dictionary with the given mime type as key and then get the value of that key.

jfif
jpeg
jpg
jpe

In the blobs there are 4 keys (image/jpeg) and hence we do overwrite the value and end up with the last key-value pair found - in this case 'jpe'.

 http://git.sugarlabs.org/projects/sugar-base/repos/mainline/blobs/master/src/sugar/mime.py#line144

Not sure there is a good priority one should follow. Maybe we should check what nautilus or others do, or define the extensions for the most common cases.

Change History

Note: See TracTickets for help on using tickets.