From 5699e5d48817efe658a6ec8326e6b47ac7f7fb51 Mon Sep 17 00:00:00 2001 From: Nishant Date: Mon, 19 Jan 2026 15:45:29 +0530 Subject: [PATCH 1/3] feat: add image compression script using Pillow --- image_compressor.py | 51 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 image_compressor.py diff --git a/image_compressor.py b/image_compressor.py new file mode 100644 index 00000000000..94d584136f6 --- /dev/null +++ b/image_compressor.py @@ -0,0 +1,51 @@ +import os +import sys +from PIL import Image + +def compress_image(image_path, quality=60): + """ + Compresses an image by reducing its quality. + + Args: + image_path (str): Path to the image file. + quality (int): Quality of the output image (1-100). Default is 60. + """ + try: + # Open the image + with Image.open(image_path) as img: + # Check if file is an image + if img.format not in ["JPEG", "PNG", "JPG"]: + print(f"Skipping {image_path}: Not a standard image format.") + return + + # Create output filename + filename, ext = os.path.splitext(image_path) + output_path = f"{filename}_compressed{ext}" + + # Save with reduced quality + # Optimize=True ensures the encoder does extra work to minimize size + img.save(output_path, quality=quality, optimize=True) + + # Calculate savings + original_size = os.path.getsize(image_path) + new_size = os.path.getsize(output_path) + savings = ((original_size - new_size) / original_size) * 100 + + print(f"[+] Compressed: {output_path}") + print(f" Original: {original_size/1024:.2f} KB") + print(f" New: {new_size/1024:.2f} KB") + print(f" Saved: {savings:.2f}%") + + except Exception as e: + print(f"[-] Error compressing {image_path}: {e}") + +if __name__ == "__main__": + if len(sys.argv) < 2: + print("Usage: python image_compressor.py ") + print("Example: python image_compressor.py photo.jpg") + else: + target_file = sys.argv[1] + if os.path.exists(target_file): + compress_image(target_file) + else: + print(f"Error: File '{target_file}' not found.") \ No newline at end of file From da7df8e2ba45b8e9dcf03bbdf2d44f64c29ca45a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Jan 2026 19:50:53 +0000 Subject: [PATCH 2/3] Bump openai from 2.14.0 to 2.15.0 Bumps [openai](https://github.com/openai/openai-python) from 2.14.0 to 2.15.0. - [Release notes](https://github.com/openai/openai-python/releases) - [Changelog](https://github.com/openai/openai-python/blob/main/CHANGELOG.md) - [Commits](https://github.com/openai/openai-python/compare/v2.14.0...v2.15.0) --- updated-dependencies: - dependency-name: openai dependency-version: 2.15.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements_with_versions.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_with_versions.txt b/requirements_with_versions.txt index 5708ce35ef3..60d5414e0c8 100644 --- a/requirements_with_versions.txt +++ b/requirements_with_versions.txt @@ -49,7 +49,7 @@ auto-mix-prep==0.2.0 lib==4.0.0 pywifi==1.1.12 patterns==0.3 -openai==2.14.0 +openai==2.15.0 background==0.2.1 pydantic==2.12.5 openpyxl==3.1.2 From b67e7da6744b82a9bf2d65c390faacf603ac2164 Mon Sep 17 00:00:00 2001 From: JAVED KHAN AHMED <149111497+JavedKhan93@users.noreply.github.com> Date: Fri, 23 Jan 2026 16:43:17 +0530 Subject: [PATCH 3/3] Add password strength checker function Implement password strength checker with criteria for length, digits, and uppercase letters. --- password_checker_code.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 password_checker_code.py diff --git a/password_checker_code.py b/password_checker_code.py new file mode 100644 index 00000000000..788b928d6b7 --- /dev/null +++ b/password_checker_code.py @@ -0,0 +1,34 @@ +import string + +def check_password_strength(password): + strength = 0 + + # Criteria 1: Length (Must be at least 8 characters) + if len(password) >= 8: + strength += 1 + + # Criteria 2: Must contain Digits (0-9) + has_digit = False + for char in password: + if char.isdigit(): + has_digit = True + break + if has_digit: + strength += 1 + + # Criteria 3: Must contain Uppercase Letters (A-Z) + has_upper = False + for char in password: + if char.isupper(): + has_upper = True + break + if has_upper: + strength += 1 + + return strength + +if __name__ == "__main__": + print("--- Password Strength Checker ---") + # Note: We cannot run input() on the website, but this code is correct. + # If users download it, it will work. + print("Run this script locally to test your password!")