Use the configured image style for the Bulk alt text form

Created on 24 September 2024, 8 months ago

Problem/Motivation

It currently defaults to large, which might not exist within the site.

It makes more sense to use the configured image style so that the user is aware of what is being sent over to the AI provider.

Steps to reproduce

Visit /admin/config/media/ai_image_bulk_alt_text, and see that it's attempting to use the large image style.

Proposed resolution

Use the configured image style.

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @codebymikey
  • codebymikey changed the visibility of the branch 3476370-use-configured-image-style to hidden.

  • Update the code a bit to meet best practices. There's still some other improvements to be made such as references to "alt tag", should probably be "alt text", but that should be handled in a separate issue with an update hook after this issue is resolved.

  • Assigned to codebymikey
  • Status changed to Needs review 5 months ago
  • I had this exact issue. I did not have the Large image style, and experienced the error below, along with a white screen when going to admin/config/media/ai_image_bulk_alt_text. Thanks to this post, I was able to add the Large image style and the page worked correctly. Thanks for the great module! My error is below:
    Message Error: Call to a member function transformDimensions() on null in template_preprocess_image_style() (line 288 of /var/www/html/website/web/core/modules/image/image.module).
    Severity Error

  • Issue was unassigned.
  • 🇮🇳India prashant.c Dharamshala
    1. Overall changes looks good
    2. Need to fix the warning
      PHP Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www/html/modules/contrib/ai_image_alt_text/modules/ai_image_bulk_alt_text/src/Form/BulkAltTextGenerateForm.php on line 304
    3. Added some comments to the PR
    4. Unassigning from @codebymikey as there is no activity since September.
    5. Keeping in the NR
Production build 0.71.5 2024