Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the image importer in case of upper case letters in the suffix #579

Merged
merged 1 commit into from
May 20, 2015

Conversation

grigorisg9gr
Copy link
Member

Fix the image importer in case of upper case letters in the suffix, e.g. name.JPG image.

@@ -630,6 +630,9 @@ def importer_for_filepath(filepath, extensions_map, importer_kwargs=None):

"""
suffix = ''.join(filepath.suffixes)
if suffix.isupper():
# If for some reason the ending is in capital letters, make them lower case first.
suffix = suffix.lower()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could just always do this? Instead of even bothering with the check? @jabooth?

@patricksnape
Copy link
Contributor

Fine with me - I think the isupper check will be faster than calling tolower every time (although the whole thing is pretty negligible)

patricksnape pushed a commit that referenced this pull request May 20, 2015
Fix the image importer in case of upper case letters in the suffix
@patricksnape patricksnape merged commit a435d78 into menpo:master May 20, 2015
@grigorisg9gr grigorisg9gr deleted the uppercase_importer branch May 29, 2015 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants