Skip to content

Commit

Permalink
fixed rebuild_dir_tree function
Browse files Browse the repository at this point in the history
  • Loading branch information
franioli committed Aug 31, 2023
1 parent 9dccd9b commit e2b6034
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/impreproc/conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ def convert(
else:
dest_paths = rebuild_dir_tree(self.image_list, self.output_dir)
for file, dest in tqdm(zip(self.image_list, dest_paths)):
dest.mkdir(parents=True, exist_ok=True)
if not convert_raw(
file, output_path=dest, profile_path=self.pp3_path, opts=self.opts
):
Expand Down Expand Up @@ -217,7 +218,7 @@ def rebuild_dir_tree(file_list: List[Path], dest_dir: Path) -> List[Path]:
elif system == "Windows":
paths = [Path(f).resolve() for f in file_list]
root = os.path.commonpath(paths)
dest_paths = [Path(dest_dir) / f.relative_to(root) for f in paths]
dest_paths = [Path(dest_dir) / f.relative_to(root).parent for f in paths]
return dest_paths


Expand Down Expand Up @@ -290,7 +291,7 @@ def select_path_gui():
output_dir = "./data/converted"
pp3_path = "./data/conversion/dji_p1_lightContrast_amaze0px.pp3"
recursive = True
keep_dir_tree = False
keep_dir_tree = True
rawtherapee_opts = ("-j100", "-js3", "-Y")

files = ImageList(data_dir, image_ext=image_ext, recursive=recursive)
Expand Down

0 comments on commit e2b6034

Please sign in to comment.