Skip to content

Commit

Permalink
fixed keep_dir_tree option
Browse files Browse the repository at this point in the history
  • Loading branch information
franioli committed Aug 31, 2023
1 parent 73471a4 commit 9dccd9b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/impreproc/conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,9 @@ def rebuild_dir_tree(file_list: List[Path], dest_dir: Path) -> List[Path]:
if system == "Linux" or system == "Darwin":
paths = [f.resolve() for f in file_list]
elif system == "Windows":
paths = [Path(f) for f in file_list]
root = os.path.commonprefix(paths)
dest_paths = [Path(dest_dir) / f.relative_to(root).parent for f in paths]
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]
return dest_paths


Expand Down Expand Up @@ -286,14 +286,14 @@ def select_path_gui():
print(path)

data_dir = "./data/conversion/"
image_ext = "dng"
image_ext = "DNG"
output_dir = "./data/converted"
pp3_path = "./data/conversion/dji_p1_lightContrast_amaze0px.pp3"
recursive = True
keep_dir_tree = True
keep_dir_tree = False
rawtherapee_opts = ("-j100", "-js3", "-Y")

files = ImageList(data_dir, image_ext=image_ext, recursive=recursive)
files = ImageList(data_dir, image_ext=image_ext, recursive=recursive)
print(files.head)

# ret = convert_raw(files[0], output_dir, pp3_path)
Expand Down
6 changes: 6 additions & 0 deletions src/impreproc/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ def __init__(
>>> data_dir = Path("/path/to/image/directory")
>>> image_list = ImageList(data_dir, image_ext=["jpg", "png"], recursive=True)
TODO:
Fix case-sensitive search in Linux environments.
"""
logging.warning(
"ImageList class is currentely case-sensitive in Linux environments. This will be fixed in the next release."
)
self._files = read_image_list(
data_dir=data_dir,
image_ext=image_ext,
Expand Down

0 comments on commit 9dccd9b

Please sign in to comment.