+ @staticmethod
+ def add_source_note(wlpic, img):
+ from PIL import ImageDraw, ImageFont
+ from librarian import get_resource
+
+ annotated = Image.new(img.mode,
+ (img.size[0], img.size[1] + 40),
+ (255, 255, 255)
+ )
+ annotated.paste(img, (0, 0))
+ annotation = Image.new(img.mode, (3000, 120), (255, 255, 255))
+ ImageDraw.Draw(annotation).text(
+ (30, 15),
+ wlpic.picture_info.source_name,
+ (0, 0, 0),
+ font=ImageFont.truetype(get_resource("fonts/DejaVuSerif.ttf"), 75)
+ )
+ annotated.paste(annotation.resize((1000, 40), Image.ANTIALIAS), (0, img.size[1]))
+ return annotated
+