Skip to content

Commit 1f83cdb

Browse files
authored
Merge pull request #28 from IEEE-SB-RIT/eventUpdates
Event updates
2 parents 452f67c + ad65971 commit 1f83cdb

36 files changed

+22
-0
lines changed

organize.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import os
2+
from PIL import Image
3+
source_path="C:\\Users\\farza\\WebstormProjects\\Roboignite\\public\\Organize"
4+
dest_path="C:\\Users\\farza\\WebstormProjects\\Roboignite\\public\\roboGallery"
5+
6+
os.makedirs(dest_path, exist_ok=True)
7+
8+
extension="jpg"
9+
files = [f for f in os.listdir(source_path) if f.lower().endswith(extension.lower())]
10+
11+
12+
for idx,file in enumerate(files,start=1):
13+
img_path = os.path.join(source_path, file)
14+
new_file_name = f"Day1_{idx:02d}.webp"
15+
save_path = os.path.join(dest_path, new_file_name)
16+
17+
with Image.open(img_path) as img:
18+
img.save(save_path, "WEBP", quality=90)
19+
20+
os.remove(img_path)
21+
22+
print(f"Image {file} has been saved to destination as {new_file_name}")

public/roboGallery/img_1.webp

-350 KB
Binary file not shown.

public/roboGallery/img_10.webp

-427 KB
Binary file not shown.

public/roboGallery/img_11.webp

-480 KB
Binary file not shown.

public/roboGallery/img_12.webp

-571 KB
Binary file not shown.

public/roboGallery/img_13.webp

-619 KB
Binary file not shown.

public/roboGallery/img_14.webp

-679 KB
Binary file not shown.

public/roboGallery/img_15.webp

-582 KB
Binary file not shown.

public/roboGallery/img_16.webp

-562 KB
Binary file not shown.

public/roboGallery/img_17.webp

-682 KB
Binary file not shown.

0 commit comments

Comments
 (0)