How to use the exif.process_file function in exif

To help you get started, we’ve selected a few exif examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github freevo / freevo1 / iview.py View on Github external
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)), \