@@ -108,7 +108,6 @@ def prepare_frames(self):
108108 offset = extract_name (frame ).replace ("-" , ":" ).split ("." )[0 ]
109109 progress .update ("Processing [bold]%s[/bold] frame" % offset )
110110 with Image .open (frame ) as image :
111- image = image .resize ((self .width , self .height ), Image .ANTIALIAS )
112111 master .paste (image , (x , y ))
113112
114113 with Progress ("Saving the result at '%s'" % master_path ):
@@ -124,9 +123,8 @@ def format_time(secs):
124123 route = os .path .join (prefix , extract_name (self .filepath ) + ".png" )
125124 route = pathlib .Path (route ).as_posix ()
126125
127- with Progress ("Saving thumbnail metadata at '%s'" % self .metadata_path ) as progress :
126+ with Progress ("Saving thumbnail metadata at '%s'" % self .metadata_path ):
128127 for _ , start , end , x , y in self .thumbnails ():
129- progress .update ("Generating metadata for '%s'" % route )
130128 thumbnail_data = "%s --> %s\n %s#xywh=%d,%d,%d,%d\n \n " % (
131129 format_time (start ), format_time (end ),
132130 route , x , y , self .width , self .height ,
@@ -148,17 +146,17 @@ def calc_thumbnail_dir(self):
148146 return ensure_tree (os .path .join (basedir , extract_name (self .filepath )), True )
149147
150148 def prepare_frames (self ):
151- if os .path .exists (self .thumbnail_dir ):
152- remove_tree (self .thumbnail_dir )
153- copy_tree (self .tempdir .name , self .thumbnail_dir )
149+ with Progress ("Copying the frames to the output directory" ):
150+ if os .path .exists (self .thumbnail_dir ):
151+ remove_tree (self .thumbnail_dir )
152+ copy_tree (self .tempdir .name , self .thumbnail_dir )
154153
155154 def generate (self ):
156155 metadata = {}
157156
158- for frame , start , * _ in self .thumbnails ():
159- frame = os .path .join (self .thumbnail_dir , os .path .basename (frame ))
160- with Image .open (frame ) as image :
161- image .resize ((self .width , self .height ), Image .ANTIALIAS ).save (frame )
157+ with Progress ("Saving thumbnail metadata at '%s'" % self .metadata_path ):
158+ for frame , start , * _ in self .thumbnails ():
159+ frame = os .path .join (self .thumbnail_dir , os .path .basename (frame ))
162160 base = os .path .join (self .base , os .path .basename (self .thumbnail_dir ))
163161 prefix = base if self .base else os .path .relpath (self .thumbnail_dir )
164162 route = os .path .join (prefix , os .path .basename (frame ))
0 commit comments