(self,string)
return string
Sets the string, to create the Robohash
Sets the string, to create the Robohash
Sets the string to create the Robohash
def _remove_exts(self,string):
        """
        Sets the string, to create the Robohash
        """

        # If the user hasn't disabled it, we will detect image extensions, such as .png, .jpg, etc.
        # We'll remove them from the string before hashing.
        # This ensures that /Bear.png and /Bear.bmp will send back the same image, in different formats.

        if string.lower().endswith(('.png','.gif','.jpg','.bmp','.jpeg','.ppm','.datauri')):
            format = string[string.rfind('.') +1 :len(string)]
            if format.lower() == 'jpg':
                    format = 'jpeg'
            self.format = format
            string = string[0:string.rfind('.')]
        return string
def _remove_exts ( self , string ) : # If the user hasn't disabled it, we will detect image extensions, such as .png, .jpg, etc. # We'll remove them from the string before hashing. # This ensures that /Bear.png and /Bear.bmp will send back the same image, in different formats. if string . lower ( ) . endswith ( ( '.png' , '.gif' , '.jpg' , '.bmp' , '.jpeg' , '.ppm' , '.datauri' ) ) : format = string [ string . rfind ( '.' ) + 1 : len ( string ) ] if format . lower ( ) == 'jpg' : format = 'jpeg' self . format = format string = string [ 0 : string . rfind ( '.' ) ] return string