Skip to content

R35-T032: Define the supported boundaries of PNG To JPG (main.py) - #62

Closed
suraj-3010 wants to merge 1 commit into
S-AI-Projects:mainfrom
suraj-3010:student/e26b07f1007/R35-T032
Closed

suraj-3010 wants to merge 1 commit into
S-AI-Projects:mainfrom
suraj-3010:student/e26b07f1007/R35-T032

Conversation

@suraj-3010

Copy link
Copy Markdown

Description

This PR defines and validates the supported boundaries of the PNG To JPG conversion logic in PNG To JPG/main.py by establishing explicit preconditions, valid domain limits (smallest 1x1 input and ordinary input), and failure handling for unsupported inputs.

Related Issue

Fixes: #32

Type of Change

  • Bug Fix
  • New Feature
  • UI/UX Improvement
  • Performance Improvement
  • Tests
  • Documentation
  • Refactoring / Maintenance
  • CI/CD

Changes Made

  • Encapsulated image conversion logic in convert_png_to_jpg(img_file, quality=95) with boundary documentation and input guards in PNG To JPG/main.py.
  • Preserved existing batch conversion functionality in convert_all_png(pattern="*.png", quality=95) with if __name__ == '__main__': script entry point.
  • Added focused boundary tests in PNG To JPG/test_png_to_jpg.py testing smallest input (1x1 RGBA), ordinary input (100x100 RGB), quality bounds (1 and 100), and unsupported inputs (FileNotFoundError for non-existent files and ValueError for invalid quality).
  • Added work/R35-T032/check.py runner and work/R35-T032/evidence.md with comprehensive boundary table and execution logs.

Screenshots / Recordings

There is no UI change.

Testing

  1. Ran python3 work/R35-T032/check.py: PASS (all 5 boundary tests and verification checks passed).
  2. Ran FORCE_WRONG=1 python3 work/R35-T032/check.py: FAIL (exited with code 1 upon deliberate size mismatch).
  3. Ran python3 -m unittest "PNG To JPG/test_png_to_jpg.py": PASS (5 tests ran in 0.002s, OK).

Checklist

  • I have tested my changes locally.
  • I have added or updated tests, if needed.
  • I have updated documentation, if needed.
  • I have followed the project's coding guidelines.
  • I have run the relevant tests and checks.
  • I have addressed previous review feedback, if applicable.

Additional Notes

Evidence and check artifacts are recorded under work/R35-T032/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant