Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def drawosd(self):
if not self.osd: return
f = open(self.filename, 'r')
tags = exif.process_file(f)
# Make the background darker for the OSD info
osd.drawbox(0, osd.height - 110, osd.width, osd.height, width=-1,
color=((60 << 24) | osd.COL_BLACK))
pos = 50
if tags.has_key('Image DateTime') and \
tags.has_key('EXIF ExifImageWidth') and tags.has_key('EXIF ExifImageLength'):
osd.drawstring('%s (%s x %s) @ %s' % \
(os.path.basename(self.filename),
tags['EXIF ExifImageWidth'], tags['EXIF ExifImageLength'], \
tags['Image DateTime']), \
20, osd.height - pos, fgcolor=osd.COL_ORANGE)
else:
osd.drawstring('%s' % (os.path.basename(self.filename)), \