[Bugs] #2267 UNSP: Do we get the right file extension with mime.get_primary_extension(mime_type) ?

Sugar Labs Bugs bugtracker-noreply at sugarlabs.org
Wed Sep 1 07:02:28 EDT 2010


#2267: Do we get the right file extension with
mime.get_primary_extension(mime_type) ?
------------------------------------------+---------------------------------
    Reporter:  erikos                     |          Owner:  tomeu                      
        Type:  defect                     |         Status:  new                        
    Priority:  Unspecified by Maintainer  |      Milestone:  Unspecified by Release Team
   Component:  sugar                      |        Version:  Git as of bugdate          
    Severity:  Unspecified                |       Keywords:                             
Distribution:  Unspecified                |   Status_field:  Unconfirmed                
------------------------------------------+---------------------------------
 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.

-- 
Ticket URL: <http://bugs.sugarlabs.org/ticket/2267>
Sugar Labs <http://sugarlabs.org/>
Sugar Labs bug tracking system


More information about the Bugs mailing list