Skip to content

Commit

Permalink
tided up the code abit
Browse files Browse the repository at this point in the history
  • Loading branch information
CanaanGM committed Dec 23, 2022
1 parent d48f14c commit bf81932
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions organization_via_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,24 @@
from typing import List

def organize_images(source: str, destination: str) -> None:
"""takes images from the `source` and throws them into `destination`

Args:
source (str): Path of the directory in which the images live
destination (str): Path of the directory where u want the images to be
"""
source_dir_files = os.listdir(source)

animated_dir = path.join(destination, "animated")
normal_dir = path.join(destination, "random")

for dir_ in (destination, animated_dir, normal_dir):
_create_dir_if_doesnt_exist(dir_)


# Iterate over the files in the source directory
for file_name in source_dir_files:
# Get the full path of the file


file_path = path.join(source, file_name)


images_extensions = ["jpg" , "png", "jpeg"]
animated_images_extensions = ["gif", "apng", "avif"]

Expand Down

0 comments on commit bf81932

Please sign in to comment.