From e2b6034af12817bfd7ce701743319b813c4492ff Mon Sep 17 00:00:00 2001 From: Francesco Ioli Date: Thu, 31 Aug 2023 18:10:26 +0200 Subject: [PATCH] fixed rebuild_dir_tree function --- src/impreproc/conversion.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/impreproc/conversion.py b/src/impreproc/conversion.py index c629134..48bfd87 100755 --- a/src/impreproc/conversion.py +++ b/src/impreproc/conversion.py @@ -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 ): @@ -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 @@ -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)