Skip to content

fix: derive file extension from output_format in generate_image#502

Open
wangwangbobo wants to merge 3 commits into
strands-agents:mainfrom
wangwangbobo:main
Open

fix: derive file extension from output_format in generate_image#502
wangwangbobo wants to merge 3 commits into
strands-agents:mainfrom
wangwangbobo:main

Conversation

@wangwangbobo

Copy link
Copy Markdown
Contributor

Fixes #500

generate_image was saving files with hardcoded .png extension regardless of the requested output_format. JPEG bytes were landing in .png files.

Fix: Derive the file extension from output_format parameter (jpeg→.jpg, png→.png).

Changes:

  • Added extension mapping: ext = "jpg" if output_format == "jpeg" else output_format
  • Updated both base_image_path and the collision-loop image_path to use {ext}

3 lines changed, no new dependencies.

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.

[BUG] generate_image saves files with a hardcoded .png extension regardless of output_format

1 participant