title = os.path.basename(wpaper)
title = re.sub(r'\.[^\.]*$', '', title)
title = re.sub(r'_+', ' ', title)
+log.debug("New title from filename: %r", title)
new_img_fname = '/tmp/wallpaper.jpg'
old_img = Image(filename = wpaper)
new_img = old_img.clone()
exif = {}
+comment = None
+re_comment = re.compile(r'^comment\s*$', re.IGNORECASE)
for k, v in old_img.metadata.items():
exif[k] = v
+ if re_comment.search(k):
+ comment = v
log.debug("Found Metadata:\n%s", pp(exif))
+if comment:
+ log.debug("Found comment: %r", comment)
+ for line in comment.splitlines():
+ line = line.strip()
+ if line:
+ title = line
+ log.debug("New title from comment: %r", title)
+ break
(screen_width, screen_height) = get_max_monitor_geometry()
new_height = screen_height