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<()> {
278
278
image. save ( & output) ?;
279
279
}
280
280
} else {
281
+ let digits = frames. len ( ) . to_string ( ) . len ( ) ;
281
282
for ( frame, image) in frames. iter ( ) . enumerate ( ) {
282
283
let mut path: PathBuf = ( & output) . into ( ) ;
283
- path. push ( format ! ( "{frame}.png" ) ) ;
284
+ path. push ( format ! ( "{frame:0digits$ }.png" ) ) ;
284
285
image. save ( & path) ?;
285
286
}
286
287
}
@@ -372,9 +373,10 @@ fn capture_multiple_swfs(descriptors: Arc<Descriptors>, opt: &Opt) -> Result<()>
372
373
relative_path. set_extension ( "" ) ;
373
374
parent. push ( & relative_path) ;
374
375
let _ = create_dir_all ( & parent) ;
376
+ let digits = frames. len ( ) . to_string ( ) . len ( ) ;
375
377
for ( frame, image) in frames. iter ( ) . enumerate ( ) {
376
378
let mut destination = parent. clone ( ) ;
377
- destination. push ( format ! ( "{frame}.png" ) ) ;
379
+ destination. push ( format ! ( "{frame:0digits$ }.png" ) ) ;
378
380
image. save ( & destination) ?;
379
381
}
380
382
}
You can’t perform that action at this time.
0 commit comments