def get_url_path(self, basedir, original_basename, ext, name, obscure=True):
        """Determines an appropriate watermark path"""

        try:
            hash = hashlib.sha1(smart_str(name)).hexdigest()
        except TypeError:
            hash = hashlib.sha1(smart_str(name).encode('utf-8')).hexdigest()

        # figure out where the watermark would be saved on the filesystem
        if obscure is True:
            logger.debug('Obscuring original image name: %s => %s' % (name, hash))
            url_path = os.path.join(basedir, hash + ext)
        else:
            logger.debug('Not obscuring original image name.')
            url_path = os.path.join(basedir, hash, original_basename + ext)

        # make sure the destination directory exists
        try:
            fpath = self._get_filesystem_path(url_path)
            os.makedirs(os.path.dirname(fpath))
        except OSError as e:
            if e.errno == errno.EEXIST:
                pass  # not to worry, directory exists
            else:
                logger.error('Error creating path: %s' % traceback.format_exc())
                raise
        else:
            logger.debug('Created directory: %s' % os.path.dirname(fpath))

        return url_path
Determines an appropriate watermark path