Skip to content

Commit af1bad7

Browse files
Merge branch 'main' of programmerraja:programmerraja/programmerraja.github.io into main
2 parents 32e284d + c3c2e6e commit af1bad7

File tree

304 files changed

+21349
-27753
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

304 files changed

+21349
-27753
lines changed

404.html

Lines changed: 31 additions & 0 deletions
Large diffs are not rendered by default.
723 KB
Loading
1.33 MB
Loading
1 MB
Loading
6.93 KB
Loading
350 KB
Loading
104 KB
Loading
137 KB
Loading
89.2 KB
Loading
1.16 MB
Loading
30.1 KB
Loading
19.1 KB
Loading
Loading

Images/image-(6)-(1).png

155 KB
Loading

Images/jira.png

2.56 MB
Loading

Images/jirasubtask.png

72.1 KB
Loading

Images/leaderboard.png

91.8 KB
Loading
File renamed without changes.

Images/png.py

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import os
2+
from PIL import Image
3+
4+
5+
def convert_images_to_png(folder_path):
6+
for filename in os.listdir(folder_path):
7+
if filename.endswith(".webp"):
8+
file_path = os.path.join(folder_path, filename)
9+
10+
with Image.open(file_path) as img:
11+
png_filename = f"{os.path.splitext(filename)[0]}.png"
12+
png_path = os.path.join(folder_path, png_filename)
13+
img.save(png_path, "PNG")
14+
15+
print(f"Converted: {filename} -> {png_filename}")
16+
os.remove(file_path)
17+
18+
19+
if __name__ == "__main__":
20+
folder_path = "./"
21+
22+
convert_images_to_png(folder_path)
23+
24+
25+
# import os
26+
# from PIL import Image
27+
28+
# target_width = 300
29+
# target_height = 800
30+
31+
32+
# def convert_images_to_png(folder_path):
33+
# for filename in os.listdir(folder_path):
34+
# if filename.endswith(".webp"):
35+
# file_path = os.path.join(folder_path, filename)
36+
37+
# with Image.open(file_path) as img:
38+
# # Calculate the new dimensions while maintaining the aspect ratio
39+
# img_ratio = img.width / img.height
40+
# target_ratio = target_width / target_height
41+
42+
# if img_ratio > target_ratio:
43+
# # Image is wider, adjust width
44+
# new_width = target_width
45+
# new_height = round(target_width / img_ratio)
46+
# else:
47+
# # Image is taller, adjust height
48+
# new_height = target_height
49+
# new_width = round(target_height * img_ratio)
50+
51+
# # Resize the image
52+
# resized_img = img.resize((new_width, new_height), Image.Resampling.LANCZOS)
53+
54+
# # Convert to PNG format and save
55+
# png_filename = f"{os.path.splitext(filename)[0]}.png"
56+
# png_path = os.path.join(folder_path, png_filename)
57+
# resized_img.save(png_path, "PNG")
58+
59+
# print(f"Converted: {filename} -> {png_filename}")
60+
# os.remove(file_path)
61+
62+
63+
# if __name__ == "__main__":
64+
# folder_path = "./"
65+
66+
# convert_images_to_png(folder_path)

blog/2024-01-31/index.html

Lines changed: 0 additions & 208 deletions
This file was deleted.

0 commit comments

Comments
 (0)