@safe_filter(error_output=False)<EOL>@register.filter<EOL>def is_portrait(file_):
if sorl_settings.THUMBNAIL_DUMMY:<EOL><INDENT>return sorl_settings.THUMBNAIL_DUMMY_RATIO < <NUM_LIT:1><EOL><DEDENT>if not file_:<EOL><INDENT>return False<EOL><DEDENT>image_file = default.kvstore.get_or_set(ImageFile(file_))<EOL>return image_file.is_portrait()<EOL>
A very handy filter to determine if an image is portrait or landscape.