skipping already watermarked files

This commit is contained in:
bvn13 2025-04-11 15:22:32 +03:00
parent 168d43e363
commit ada2fa4681
6 changed files with 6 additions and 2 deletions

Binary file not shown.

@ -17,8 +17,9 @@ def watermark_text(input_image_path: str,
black = (3, 8, 12)
white = (254, 254, 254)
yellow = (237,255,33)
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:
photo.show()
photo.save(output_image_path)

@ -38,9 +38,12 @@ if __name__ == '__main__':
files = _find_all_files(args.input_folder, args.file_mask)
print(f"files={files}")
for file in files:
newfilename = _build_output_filename(file)
if os.path.isfile(newfilename):
continue
watermark_text_bottom_right(
input_image_path=file,
output_image_path=_build_output_filename(file),
output_image_path=newfilename,
text=args.text,
font_path=args.font,
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