Skip to content

Commit

Permalink
Improve images_to_video function
Browse files Browse the repository at this point in the history
  • Loading branch information
giswqs committed Sep 16, 2024
1 parent 1a35669 commit 404fde0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions samgeo/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -3217,6 +3217,13 @@ def images_to_video(
raise ValueError(f"The provided path {images} is not a valid directory.")

# Get all image files in the directory (sorted by filename)

files = sorted(os.listdir(images))
if len(files) == 0:
raise ValueError(f"No image files found in the directory {images}")
elif files[0].endswith(".tif"):
images = geotiff_to_jpg_batch(images)

images = [
os.path.join(images, img)
for img in sorted(os.listdir(images))
Expand Down

0 comments on commit 404fde0

Please sign in to comment.