Skip to content

feat(compress_images): add jpeg format support#93

Merged
yxlao merged 2 commits intomainfrom
yixing/jpeg-jpg
Mar 21, 2026
Merged

feat(compress_images): add jpeg format support#93
yxlao merged 2 commits intomainfrom
yixing/jpeg-jpg

Conversation

@yxlao
Copy link
Copy Markdown
Owner

@yxlao yxlao commented Mar 21, 2026

Summary

Adds JPEG format support to the compress_images tool, enabling users to output images with .jpeg extension in addition to the existing .jpg support.

Changes Made

  • Added "jpeg" to the --format argument choices and updated help text
  • Updated get_operation_string() to return operation strings for both "jpg" and "jpeg" formats (e.g., "PNG→JPEG Q90")
  • Modified entry_point() to treat jpeg same as jpg for same-format compression logic
  • Updated is_same_format check to include args.format in ["jpg", "jpeg"]
  • Added conditional suffix handling to use .jpeg extension when output format is jpeg
  • Updated error message to reference "JPG/JPEG" instead of just "JPG"
  • Updated compression ratio skip logic to apply to both jpg and jpeg
  • Added documentation example: ct compress-images image.png --format jpeg --quality 90

@yxlao yxlao merged commit f6f9aae into main Mar 21, 2026
10 checks passed
@yxlao yxlao deleted the yixing/jpeg-jpg branch March 21, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant