diff --git a/CHANGELOG.md b/CHANGELOG.md index 039b1cd..41cfb59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added * Support to generate KiRi SVGs +### Fixed +* PNGs not removed when no diff and only_different was specified + + ## [2.4.7] - 2023-03-29 ### Fixed * The message about different page size for the red_green mode diff --git a/kicad-diff.py b/kicad-diff.py index 44fe7bf..27b505c 100755 --- a/kicad-diff.py +++ b/kicad-diff.py @@ -452,7 +452,7 @@ def DiffImages(old_file_hash, new_file_hash, layers_old, layers_new, only_differ all_layers = {} all_layers.update(layers_old) all_layers.update(layers_new) - skipped = 0 + skipped = [] for i in sorted(all_layers.keys()): if svg_mode: # Multisheet schematic @@ -496,7 +496,7 @@ def DiffImages(old_file_hash, new_file_hash, layers_old, layers_new, only_differ if inc: files.append(diff_name) else: - skipped = skipped+1 + skipped.append(diff_name) # Check if we skipped all if len(files) == 1 and skipped: files.append(create_no_diff(output_dir)) @@ -524,7 +524,7 @@ def DiffImages(old_file_hash, new_file_hash, layers_old, layers_new, only_differ rename(output_pdf, out_name) # Remove the individual PNGs if not args.keep_pngs: - for f in files[1:-1]: + for f in files[1:-1]+skipped: remove(f) return out_name