def load_image(self, imagepath, width=None, height=None):
if width:<EOL><INDENT>self.width = width<EOL>self.canvas["<STR_LIT:width>"] = width<EOL><DEDENT>if height:<EOL><INDENT>self.height = height<EOL>self.canvas["<STR_LIT>"] = height<EOL><DEDENT>self.image = imagepath<EOL>size = (self.width, self.height)<EOL>load_image(self.canvas, self.image, bounds=size)<EOL>self.canvas.update_idletasks()<EOL>
Loads new image into canvas, updating size if needed.