File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -278,9 +278,10 @@ fn capture_single_swf(descriptors: Arc<Descriptors>, opt: &Opt) -> Result<()> {
278278 image. save ( & output) ?;
279279 }
280280 } else {
281+ let digits = frames. len ( ) . to_string ( ) . len ( ) ;
281282 for ( frame, image) in frames. iter ( ) . enumerate ( ) {
282283 let mut path: PathBuf = ( & output) . into ( ) ;
283- path. push ( format ! ( "{frame}.png" ) ) ;
284+ path. push ( format ! ( "{frame:0digits$ }.png" ) ) ;
284285 image. save ( & path) ?;
285286 }
286287 }
@@ -372,9 +373,10 @@ fn capture_multiple_swfs(descriptors: Arc<Descriptors>, opt: &Opt) -> Result<()>
372373 relative_path. set_extension ( "" ) ;
373374 parent. push ( & relative_path) ;
374375 let _ = create_dir_all ( & parent) ;
376+ let digits = frames. len ( ) . to_string ( ) . len ( ) ;
375377 for ( frame, image) in frames. iter ( ) . enumerate ( ) {
376378 let mut destination = parent. clone ( ) ;
377- destination. push ( format ! ( "{frame}.png" ) ) ;
379+ destination. push ( format ! ( "{frame:0digits$ }.png" ) ) ;
378380 image. save ( & destination) ?;
379381 }
380382 }
You can’t perform that action at this time.
0 commit comments