Commits

David Larlet committed a9ccf71

Image: Use os.path.splitext in image storage rather than custom code. Thanks Michael Elsdörfer.

Comments (0)

Files changed (1)

         
         # Does the basename already have an extension? If so, replace it.
         # bare as in without extension
-        bare_basename = basename if '.' not in basename else basename[:basename.rindex('.')]
+        bare_basename, _ = os.path.splitext(basename)
         basename = bare_basename + '.' + extension
         
         name = os.path.join(dirname, basename)