Skip to content

new features#10

Merged
razzkumar merged 2 commits into
mainfrom
new-features
Mar 3, 2026
Merged

new features#10
razzkumar merged 2 commits into
mainfrom
new-features

Conversation

@razzkumar
Copy link
Copy Markdown
Owner

  • fix: implement HIGH and MEDIUM priority improvements across codebase
  • test: add comprehensive test coverage for all recent changes

razzkumar and others added 2 commits March 3, 2026 08:42
Address 13 identified issues (5 HIGH, 8 MEDIUM) plus a bonus fix:

HIGH fixes:
- H1: Deduplicate detection providers - extract shared buildDetectionPrompt,
  parseJSONDetectionResponse, extractLabelsFromPlainText, parseTextResponse
  into detection.go; providers become thin wrappers
- H2: Surface metadata write errors via MetadataWriteWarning type with
  Unwrap() support instead of silently swallowing
- H3: Fix formatFilterName() by adding Name field to ResampleFilter struct
  and setting it on all 15 filters
- H4: Unify JPEG quality default to 95 via DefaultJPEGQuality constant
- H5: Add parallelWithContext() with context cancellation support

MEDIUM fixes:
- M1: Export GCD() and FormatAspectRatio() from root package, deduplicate CLI
- M2: Fix Format.String() to return "Unknown" for invalid formats, remove
  redundant formatToString()
- M3: Deep clone DetectionResult via JSON round-trip in Clone()
- M4: Clamp encode options (JPEG [1,100], WebP [0,100], GIF [1,256])
- M5: Clean up partial file on encode/close error
- M6: Add instance-based API tests (method chain, save round-trip, clone
  independence, metadata tracking)
- M7: Add WebP support to CLI format functions
- M8: Fix mimeFromFormat() default to application/octet-stream

Bonus: Fix error prefix from "imaging:" to "imgx:"

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Cover 15 previously untested features across 3 modules:
- Root: encode option clamping, DefaultJPEGQuality, save cleanup on error,
  MetadataWriteWarning type, parallelWithContext, GCD, FormatAspectRatio
- Detection: buildDetectionPrompt, parseJSONDetectionResponse,
  extractLabelsFromPlainText, parseTextResponse
- CLI: ParseFormat, FormatName, ParseFilter, ParseAnchor, changeExtension
@razzkumar razzkumar merged commit e785061 into main Mar 3, 2026
@razzkumar razzkumar deleted the new-features branch March 3, 2026 03:38
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