Skip to content

openai-image-gen: validate and normalize unsupported --output-format values #36649

@shuofengzhang

Description

@shuofengzhang

Summary

skills/openai-image-gen/scripts/gen.py currently accepts any --output-format string for GPT image models and uses it directly for both API payload and output filename extension.

This can lead to confusing failures (unsupported API values) and inconsistent local output behavior when an invalid format is provided.

Proposed improvement

  • Normalize jpg to jpeg.
  • Validate --output-format against supported values (png, jpeg, webp) before API requests.
  • Return a clear CLI error for invalid values.

Implemented by PR: #36648

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions