From eee1442bc3c9fc05059f84eebd057aac55c66096 Mon Sep 17 00:00:00 2001 From: jlw4049 Date: Wed, 12 Jun 2024 01:02:20 -0400 Subject: [PATCH] feat: v1.2.1 feat: added '--sub-alignment' arg. This can control the position of the subtitles for everything that isn't a "sync" frame --- frame_forge.py | 6 +++++- frame_forge/__init__.py | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/frame_forge.py b/frame_forge.py index 5f2275a..9dfd498 100644 --- a/frame_forge.py +++ b/frame_forge.py @@ -7,7 +7,7 @@ from frame_forge.cli_utils import frame_list program_name = "FrameForge" -__version__ = "1.2.0" +__version__ = "1.2.1" if __name__ == "__main__": @@ -40,6 +40,9 @@ if __name__ == "__main__": "--encode-index-path", type=str, help="Path to look/create indexes for encode" ) parser.add_argument("--sub-size", type=int, default=20, help="Size of subtitles") + parser.add_argument( + "--sub-alignment", type=int, default=7, help="Alignment of subtitles (.ass)" + ) parser.add_argument("--left-crop", type=int, help="Left crop") parser.add_argument("--right-crop", type=int, help="Right crop") parser.add_argument("--top-crop", type=int, help="Top crop") @@ -114,6 +117,7 @@ if __name__ == "__main__": source_index_path=args.source_index_path, encode_index_path=args.encode_index_path, sub_size=args.sub_size, + sub_alignment=args.sub_alignment, left_crop=args.left_crop, right_crop=args.right_crop, top_crop=args.top_crop, diff --git a/frame_forge/__init__.py b/frame_forge/__init__.py index 85553ed..73d4666 100644 --- a/frame_forge/__init__.py +++ b/frame_forge/__init__.py @@ -22,6 +22,7 @@ class GenerateImages: source_index_path: None | str, encode_index_path: None | str, sub_size: int, + sub_alignment: int, left_crop: int, right_crop: int, top_crop: int, @@ -47,6 +48,7 @@ class GenerateImages: self.source_index_path = source_index_path self.encode_index_path = encode_index_path self.sub_size = sub_size + self.sub_alignment = sub_alignment self.left_crop = left_crop self.right_crop = right_crop self.top_crop = top_crop @@ -88,7 +90,7 @@ class GenerateImages: selected_sub_style = ( f"Segoe UI,{self.sub_size},{color},&H00000000,&H00000000,&H00000000," - "1,0,0,0,100,100,0,0,1,1,0,7,10,10,10,1" + f"1,0,0,0,100,100,0,0,1,1,0,{self.sub_alignment},10,10,10,1" ) sync_sub_base = ( "Segoe UI,{size},&H31FF31&,&H00000000,&H00000000,&H00000000,"