skipping already watermarked files
This commit is contained in:
parent
168d43e363
commit
ada2fa4681
Binary file not shown.
@ -17,8 +17,9 @@ def watermark_text(input_image_path: str,
|
|||||||
|
|
||||||
black = (3, 8, 12)
|
black = (3, 8, 12)
|
||||||
white = (254, 254, 254)
|
white = (254, 254, 254)
|
||||||
|
yellow = (237,255,33)
|
||||||
font = ImageFont.truetype(font_path, size, encoding='unic')
|
font = ImageFont.truetype(font_path, size, encoding='unic')
|
||||||
drawing.text(pos, text=text, fill=white, font=font, anchor="la")
|
drawing.text(pos, text=text, fill=yellow, font=font, anchor="la")
|
||||||
if show:
|
if show:
|
||||||
photo.show()
|
photo.show()
|
||||||
photo.save(output_image_path)
|
photo.save(output_image_path)
|
||||||
|
5
main.py
5
main.py
@ -38,9 +38,12 @@ if __name__ == '__main__':
|
|||||||
files = _find_all_files(args.input_folder, args.file_mask)
|
files = _find_all_files(args.input_folder, args.file_mask)
|
||||||
print(f"files={files}")
|
print(f"files={files}")
|
||||||
for file in files:
|
for file in files:
|
||||||
|
newfilename = _build_output_filename(file)
|
||||||
|
if os.path.isfile(newfilename):
|
||||||
|
continue
|
||||||
watermark_text_bottom_right(
|
watermark_text_bottom_right(
|
||||||
input_image_path=file,
|
input_image_path=file,
|
||||||
output_image_path=_build_output_filename(file),
|
output_image_path=newfilename,
|
||||||
text=args.text,
|
text=args.text,
|
||||||
font_path=args.font,
|
font_path=args.font,
|
||||||
pos=(1000, 200),
|
pos=(1000, 200),
|
||||||
|
Binary file not shown.
Before ![]() (image error) Size: 1.4 MiB After ![]() (image error) Size: 1.5 MiB ![]() ![]() |
Binary file not shown.
Before ![]() (image error) Size: 944 KiB After ![]() (image error) Size: 944 KiB ![]() ![]() |
Binary file not shown.
Before ![]() (image error) Size: 944 KiB After ![]() (image error) Size: 945 KiB ![]() ![]() |
Loading…
x
Reference in New Issue
Block a user