Skip to content
This repository was archived by the owner on May 25, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ Sr no | Project Name | Author
10 | [Split Folders into Subfolders](https://github.com/chavarera/python-mini-projects/tree/master/projects/split%20folder%20into%20subfolders) | [Ravi Chavare](https://github.com/chavarera)
11 | [Download bulk images](https://github.com/chavarera/python-mini-projects/tree/master/projects/download%20images%20from%20website) | [Mitesh](https://github.com/Mitesh2499)
12 | [Ranom word from file](https://github.com/chavarera/python-mini-projects/tree/master/projects/Random_word_from_list) |
13 | [Battery notification](https://github.com/chavarera/python-mini-projects/tree/master/projects/battery%20notification) |
13 | [Battery notification](https://github.com/chavarera/python-mini-projects/tree/master/projects/battery%20notification) | [Mitesh](https://github.com/Mitesh2499)
14 | [Calculate age](https://github.com/chavarera/python-mini-projects/tree/master/projects/Calculate%20age) | [Gaodong](https://github.com/xlgd)
15 | [Text file analysis](https://github.com/chavarera/python-mini-projects/tree/master/projects/Textfile%20analysis) | [m044de](https://github.com/m044de/)
16 | [Generate image snipets](https://github.com/chavarera/python-mini-projects/tree/master/projects/py-carbon-clips) | [ravi chavare](https://github.com/chavarera/)
17 | [Organize file system](https://github.com/chavarera/python-mini-projects/tree/master/projects/organized%20download%20folder%20with%20different%20categories) |
17 | [Organize file system](https://github.com/chavarera/python-mini-projects/tree/master/projects/organized%20download%20folder%20with%20different%20categories) | [Mitesh](https://github.com/Mitesh2499)
18 | [Send emails](https://github.com/chavarera/python-mini-projects/tree/master/projects/send%20email%20from%20CSV) | [Mitesh](https://github.com/Mitesh2499)
12 changes: 12 additions & 0 deletions projects/Terminal Progress Bar with Images Resizing/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Terminal Progress bar with image Resizing

Here I just take example of image resizing for displaying progress bar.
when we convert lots of images at time we can use progress bar to show how many images are resized.

### For this purpose I am using tqdm librabry
` pip install tqdm `

This Library is for showing progress bar

### For Resizing images
` pip install Pillow `
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
from tqdm import tqdm
from PIL import Image
import os
from time import sleep


def Resize_image(size, image):
if os.path.isfile(image):
try:
im = Image.open(image)
im.thumbnail(size, Image.ANTIALIAS)
im.save("resize/" + str(image) + ".jpg")
except Exception as ex:
print(f"Error: {str(ex)} to {image}")


path = input("Enter Path to images : ")
size = input("Size Height , Width : ")
size = tuple(map(int, size.split(",")))

os.chdir(path)

list_images = os.listdir(path)
if "resize" not in list_images:
os.mkdir("resize")

for image in tqdm(list_images, desc="Resizing Images"):
Resize_image(size, image)
sleep(0.1)
print("Resizing Completed!")