Opened 4 years ago

Last modified 2 years ago

#5444 in_progress defect

Implement 'type_match_handler' hook for all core media types

Reported by: ayleph Owned by: ayleph
Priority: major Milestone:
Component: programming Keywords: processing, sniffing
Cc: Boris Bobrov Parent Tickets:


Since the gstreamer-1.0 update, uploaded media are sniffed and very often (always?) produce messages like below, even when the media are successfully processed. Breton says this is not intentional and should be addressed.

No plugins handled extension .jpg


Change History (3)

comment:1 Changed 4 years ago by ayleph

This error comes from mediagoblin/media_types/

def type_match_handler(media_file, filename):
    if os.path.basename(filename).find('.') > 0:
        hook_result = hook_handle('type_match_handler', ext[1:])
        if hook_result:
  'No plugins handled extension {0}'.format(ext))
    else:'File {0} has no known file extension, let\'s hope '
                'the sniffers get it.'.format(filename))
    raise TypeNotFound(_(u'Sorry, I don\'t support that file type :('))

Doing a search through code for type_match_handler shows that only the video mediatype provides this hook, while all of the other media types still use the deprecated get_media_type_and_manager hook.

If get_media_type_and_manager is really deprecated, then maybe all of the other mediatypes should be updated to support type_match_handler. I'm not sure if that's the cause of this issue or if it's a separate issue that also needs to be addressed.

comment:2 Changed 2 years ago by ayleph

Summary: No plugins handled extensionImplement 'type_match_handler' hook for all core media types

I stumbled across this again and it's still an issue. We should implement the type_match_handler hook for other media types as well. I've changed the ticket summary to reflect this.

comment:3 Changed 2 years ago by ayleph

Owner: set to ayleph
Status: newin_progress
Note: See TracTickets for help on using tickets.