def _extract_prefix(filename):
    """
	>>> _extract_prefix("some_long_filename_without_hyphen.jpg")
	>>> _extract_prefix("-first_char_is_hyphen.jpg")
	>>> _extract_prefix("some_long_filename_with-stuff.jpg") # doctest: +ALLOW_UNICODE
	'some_long_filename_with'
	"""
    pos = filename.rfind('-')
    if not pos or pos < 0:
        return None
    return filename[:pos]
