Repository navigation
R35-T032: Define the supported boundaries of PNG To JPG (main.py) - #62
Closed
suraj-3010 wants to merge 1 commit into
Closed
suraj-3010 wants to merge 1 commit into
suraj-3010 wants to merge 1 commit into
Conversation
Open
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR defines and validates the supported boundaries of the PNG To JPG conversion logic in
PNG To JPG/main.pyby 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
Changes Made
convert_png_to_jpg(img_file, quality=95)with boundary documentation and input guards inPNG To JPG/main.py.convert_all_png(pattern="*.png", quality=95)withif __name__ == '__main__':script entry point.PNG To JPG/test_png_to_jpg.pytesting smallest input (1x1 RGBA), ordinary input (100x100 RGB), quality bounds (1 and 100), and unsupported inputs (FileNotFoundErrorfor non-existent files andValueErrorfor invalid quality).work/R35-T032/check.pyrunner andwork/R35-T032/evidence.mdwith comprehensive boundary table and execution logs.Screenshots / Recordings
There is no UI change.
Testing
python3 work/R35-T032/check.py: PASS (all 5 boundary tests and verification checks passed).FORCE_WRONG=1 python3 work/R35-T032/check.py: FAIL (exited with code 1 upon deliberate size mismatch).python3 -m unittest "PNG To JPG/test_png_to_jpg.py": PASS (5 tests ran in 0.002s, OK).Checklist
Additional Notes
Evidence and check artifacts are recorded under
work/R35-T032/.