Problem/Motivation

After AI Media generates an image, the name and the alternative text are copied from the description the editor typed. A description says what was asked for, not what the image shows, so the alt text is often wrong. Also, AI Media removes the AI Image Alt Text module's "Generate alt text" button from the generated image unless the settings pick that module for the alt text, so the editor cannot ask for a better alt text.

Steps to reproduce

  1. With AI Image Alt Text enabled, generate an image in the Media Library.
  2. The alt text is the description; the "Generate alt text" button is gone.

Proposed resolution

  • Default the name and the alt text to ai: written by AI from the generated image (metadata.name.source, metadata.alt.source), with the AI Prompts the module already ships.
  • Keep the AI Image Alt Text button on the generated image whatever the alt source, so the editor can write it again.
  • Sites can still pick the description, the AI Image Alt Text button, or none.

AI-Generated: Yes

Remaining tasks

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

User interface changes

  • A generated image arrives with a name and alt text written by AI from the image, and keeps the "Generate alt text" button.

API changes

  • None.

Data model changes

  • Default metadata.name.source and metadata.alt.source become ai.

Release notes snippet

  • Generated images get a name and alt text written by AI from the image, and keep the AI Image Alt Text button.

Issue fork ai_media-3633822

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

rajab natshah created an issue. See original summary.

rajab natshah’s picture

StatusFileSize
new199 KB

Merge request: !32

A generated image arrives with a name and alternative text written by AI from the image, and AI Image Alt Text's area stays under it. Screenshots from a local Varbase 11 site in Gin:

Generated image with the name and alt text written by AI from the image

rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

StatusFileSize
new196.27 KB

Updated screenshot: the AI Image Alt Text privacy consent accepted for the session first, so its Generate with AI button shows under the generated image (instead of the "Transfer image and meta data to chosen AI service?" box).

rajab natshah’s picture

Issue summary: View changes

  • rajab natshah committed 729024bd on 1.0.x
    task: #3633822 Write the name and alt text of a generated image with AI...
rajab natshah’s picture

Status: Active » Fixed
Issue tags: +ai_media-1.0.0-beta1

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.