+ imgpath = os.path.splitext(os.path.join(self.curdir, l[1]))[0] + '.jpg'
+ if os.path.exists(imgpath) :
+ img = pygame.image.load(imgpath)
+ iw, ih = img.get_width(), img.get_height()
+ style = {}
+ if iw > ih :
+ style['width'] = PICTURE_ITEM_SIZE
+ style['height'] = int(round(PICTURE_ITEM_SIZE * float(ih) / iw))
+ else :
+ style['heigth'] = PICTURE_ITEM_SIZE
+ style['width'] = int(round(PICTURE_ITEM_SIZE * float(iw) / ih))
+
+ img = basic.Image(img, style=style)
+ else :
+ img = self.soundfile_img
+ self.list.add(l[0], value = l[1], image = img)