+def res2user(res):
+ (w, h) = res
+ # get ratio
+ ratio = int(round(16.0*h/w))
+ if ratio == 12: # 16:12 = 4:3
+ strRatio = '4:3'
+ elif ratio == 13: # 16:12.8 = 5:4
+ strRatio = '5:4'
+ else: # let's just hope this will never be 14 or more...
+ strRatio = '16:%d' % ratio
+ return '%dx%d (%s)' %(w, h, strRatio)
+