Fixed indexed PNG issues

This commit is contained in:
Robert 2020-07-13 19:28:39 +02:00
parent ad3c7f0c34
commit 8178240120

View file

@ -51,9 +51,8 @@ if args.N is None:
def fetch_comments(comment) -> list: def fetch_comments(comment) -> list:
if len(comment.replies) == 0: if len(comment.replies) == 0:
c = re.sub(r'https?://\S+', '', comment.body) c = re.sub(r'(\[text\]\()?https?://[0-9A-Za-z/\?#\[\]@\.!$\&%\-+,;=]+\)?', '', comment.body)
c = re.sub(r'http?://\S+', '', c) return [re.sub(r'https?://[0-9A-Za-z/\?#\[\]@\.!$\&%\-+,;=]+', '', c)]
return [c]
raw_comments = [comment.body] raw_comments = [comment.body]
@ -95,7 +94,7 @@ mask = None
colors = None colors = None
if args.m is not None: if args.m is not None:
print("Creating mask...", end=" ", flush=True) print("Creating mask...", end=" ", flush=True)
mask = np.array(Image.open(args.m)) mask = np.array(Image.open(args.m).convert("RGB"))
colors = ImageColorGenerator(mask) colors = ImageColorGenerator(mask)
print("Done!") print("Done!")