fix: #3634446 Landscape and Portrait pick a size the image model rejects

Issue: https://www.drupal.org/project/ai_media/issues/3634446

sizeFor() sends the size the form names (1536x1024 for Landscape, 1024x1536 for Portrait) when the model lists it, and falls back to the largest listed size of that shape only when it does not. OpenAI lists DALL-E 3's 1792x1024 beside gpt-image-1's sizes, so the largest one was rejected.

Checked: phpcs, phpstan, the kernel suite, and a video generation on the dev site that failed before and passes after.

AI-Generated: Yes

Checkpoints:

  • File an issue
  • Addition/Change/Update/Fix
  • Testing to ensure no regression
  • Automated unit testing coverage
  • Automated functional testing coverage
  • UX/UI designer responsibilities
  • Readability
  • Accessibility
  • Performance
  • Security
  • Developer Documentation
  • User Guide Documentation
  • Reviewed by human
  • Code review by maintainers
  • Full testing and approval
  • Credit contributors
  • Review with the product owner
  • Release notes snippet
  • Release

🤖 Generated with Claude Code

Edited by Rajab Natshah

Merge request reports

Loading
Loading