Alt text generator module generates alt text for images using AI. You can choose language of alt text generation from the configuration dashboard of the module.

To test it, please follow the steps below:
1. Install module
2. Access the settings page at /admin/config/content/alt-text-generator to choose the language for alt text and add the API key for alt text generation. A button will then appear on image fields for generating alt texts.
3. You can use this API key for testing: b2MY5gAj4WcaFn8RU1itRWeRHej1

Project link

https://www.drupal.org/project/alt_text_generator

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

    balt1794 created an issue. See original summary.

    vishal.kadam’s picture

    Issue summary: View changes
    avpaderno’s picture

    Thank you for applying!

    Please read Review process for security advisory coverage: What to expect for more details and Security advisory coverage application checklist to understand what reviewers look for. Tips for ensuring a smooth review gives some hints for a smoother review.

    The important notes are the following.

    • If you have not done it yet, enable GitLab CI for the project, and fix what reported from the phpcs job. This help to fix most of what reviewers would report.
    • For the time this application is open, only your commits are allowed. No other people, including other maintainers/co-maintainers can make commits.
    • The purpose of this application is giving you a new drupal.org role that allows you to opt projects into security advisory coverage, either projects you already created, or projects you will create. The project status won't be changed by this application.
    • Nobody else will get the permission to opt projects into security advisory policy. If there are other maintainers/co-maintainers who will to get that permission, they need to apply with a different module.
    • We only accept an application per user. If you change your mind about the project to use for this application, or it is necessary to use a different project for the application, please update the issue summary with the link to the correct project and the issue title with the project name and the branch to review.

    To the reviewers

    Please read How to review security advisory coverage applications, Application workflow, What to cover in an application review, and Tools to use for reviews.

    The important notes are the following.

    • It is preferable to wait for a Code Review Administrator before commenting on newly created applications. Code Review Administrators will do some preliminary checks that are necessary before any change on the project files is suggested.
    • Reviewers should show the output of a CLI tool only once per application. The configuration used for these tools needs to be the same configuration used by GitLab CI, stored in the GitLab Templates repository.
    • It may be best to have the applicant fix things before further review.

    For new reviewers, I would also suggest to first read In which way the issue queue for coverage applications is different from other project queues.

    vishal.kadam’s picture

    Status: Needs review » Needs work

    1. FILE: alt_text_generator.info.yml

    core_version_requirement: ^9 || ^10 || ^11

    FILE: composer.json

        "require": {
            "php": ">=8.1",
            "drupal/core": "^9 || ^10 || ^11"
        }

    A new project should not declare itself compatible with a Drupal release that is no longer supported. No site should be using Drupal 8 nor Drupal 9, and people should not be encouraged to use those Drupal releases.

    2. FILE: alt_text_generator.libraries.yml

    version: VERSION

    VERSION is only used by Drupal core modules. Contributed modules should use a literal string that does not change with the Drupal core version a site is using.

    balt1794’s picture

    Thank you for the review. I've addressed the issues in version 1.0.2:

    1. Removed Drupal 9 support from both info.yml and composer.json as it's no longer supported
    2. Updated VERSION placeholder in libraries.yml to use literal version string '1.0.2'

    These changes have been committed and released in version 1.0.2.

    balt1794’s picture

    Status: Needs work » Needs review

    Thank you for the review. I've addressed the issues in version 1.0.2:

    1. Removed Drupal 9 support from both info.yml and composer.json as it's no longer supported
    2. Updated VERSION placeholder in libraries.yml to use literal version string '1.0.2'

    These changes have been committed and released in version 1.0.2.

    vishal.kadam’s picture

    As a side note: These applications do not require that new releases are created after reviews.

    Rest looks fine to me.

    Please wait for a Project Moderator to take a look and if everything goes fine, you will get the role.

    avpaderno’s picture

    Truly, this application should wait for other reviewers.

    bbu23’s picture

    It seems to me that this module contains too few code to be able to properly review.
    Though, as a quick look, the config/install folder with the default module settings file is missing.

    In README.md and composer.json, there are strings like "[Your Name] - https://www.drupal.org/u/[your-drupal-username]" which need replacing.

    bbu23’s picture

    Status: Needs review » Needs work
    balt1794’s picture

    Status: Needs work » Needs review

    I've fixed the issues mentioned. Please review now.

    Thanks!

    balt1794’s picture

    Priority: Normal » Major
    bbu23’s picture

    Priority: Major » Normal

    Updating priority according to issue priorities.

    balt1794’s picture

    This is ready for review

    vishal.kadam’s picture

    Status: Needs review » Needs work

    There are phpcs errors in the code. Please enable GitLab CI for the project, and fix what reported from the phpcs job.

    avpaderno’s picture

    Priority: Normal » Major
    Status: Needs work » Needs review

    If there are PHP_CodeSniffer errors/warnings, the review should at least say which ones they are.

    avpaderno’s picture

    Priority: Major » Normal
    Status: Needs review » Needs work
    • The following points are just a start and don't necessarily encompass all of the changes that may be necessary
    • A specific point may just be an example and may apply in other places
    • A review is about code that does not follow the coding standards, contains possible security issue, or does not correctly use the Drupal API
    • The single review points are not ordered, not even by importance

    src/Controller/AltTextGeneratorController.php

    Since that class does not use methods from the parent class, it does not need to use ControllerBase as parent class. Controllers do not need to have a parent class; as long as they implement \Drupal\Core\DependencyInjection\ContainerInjectionInterface, they are fine.

    alt_text_generator.module

    For a new module that aims to be compatible with Drupal 10 and Drupal 11, I would rather implement hooks as class methods as described in Support for object oriented hook implementations using autowired services.
    It would require increasing the minimum Drupal 10 version supported, but Drupal 10.1 is no longer supported.

    vishal.kadam’s picture

    Fix phpcs issues.

    phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml alt_text_generator/
    
    FILE: /home/vishalkadam/DRUPAL-CONTRIBUTE/alt_text_generator/alt_text_generator.links.menu.yml
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     5 | ERROR | [x] Expected 1 newline at end of file; 0 found
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    FILE: /home/vishalkadam/DRUPAL-CONTRIBUTE/alt_text_generator/README.md
    -----------------------------------------------------------------------
    FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
    -----------------------------------------------------------------------
      5 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
     38 | ERROR   | [x] Expected 1 newline at end of file; 0 found
    -----------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -----------------------------------------------------------------------
    
    FILE: /home/vishalkadam/DRUPAL-CONTRIBUTE/alt_text_generator/config/schema/alt_text_generator.schema.yml
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     10 | ERROR | [x] Expected 1 newline at end of file; 0 found
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    FILE: /home/vishalkadam/DRUPAL-CONTRIBUTE/alt_text_generator/config/install/alt_text_generator.settings.yml
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     2 | ERROR | [x] Expected 1 newline at end of file; 0 found
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    FILE: /home/vishalkadam/DRUPAL-CONTRIBUTE/alt_text_generator/src/Form/AltTextGeneratorSettingsForm.php
    --------------------------------------------------------------------------------
    FOUND 5 ERRORS AND 4 WARNINGS AFFECTING 6 LINES
    --------------------------------------------------------------------------------
       7 | WARNING | [x] Unused use statement
      82 | WARNING | [x] A comma should follow the last multiline array item. Found: 'https://alttextgeneratorai.com/dashboard'
     114 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
     124 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
     144 | ERROR   | [x] Expected 1 blank line after function; 0 found
     145 | ERROR   | [x] The closing brace for the class must have an empty line before it
     145 | ERROR   | [ ] Closing class brace must be on a line by itself
     145 | ERROR   | [x] Expected 1 newline at end of file; 0 found
     145 | ERROR   | [x] Whitespace found at end of line
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    FILE: /home/vishalkadam/DRUPAL-CONTRIBUTE/alt_text_generator/src/Form/AltTextGenerator.php
    --------------------------------------------------------------------------------
    FOUND 8 ERRORS AFFECTING 6 LINES
    --------------------------------------------------------------------------------
     27 | ERROR | [x] Whitespace found at end of line
     28 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
     30 | ERROR | [x] Whitespace found at end of line
     31 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
     33 | ERROR | [x] Whitespace found at end of line
     37 | ERROR | [ ] Closing class brace must be on a line by itself
     37 | ERROR | [x] Expected 1 newline at end of file; 0 found
     37 | ERROR | [x] Whitespace found at end of line
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    FILE: /home/vishalkadam/DRUPAL-CONTRIBUTE/alt_text_generator/src/Controller/AltTextGeneratorController.php
    --------------------------------------------------------------------------------
    FOUND 7 ERRORS AND 3 WARNINGS AFFECTING 8 LINES
    --------------------------------------------------------------------------------
      13 | ERROR   | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Config\ConfigFactoryInterface.
      90 | WARNING | [ ] File::load calls should be avoided in classes, use dependency injection instead
     109 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
     114 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
     131 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
     132 | ERROR   | [ ] The array declaration extends to column 84 (the limit is 80). The array content should be split up over multiple lines
     135 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
     140 | ERROR   | [ ] Closing class brace must be on a line by itself
     140 | ERROR   | [x] Expected 1 newline at end of file; 0 found
     140 | ERROR   | [x] Whitespace found at end of line
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    FILE: /home/vishalkadam/DRUPAL-CONTRIBUTE/alt_text_generator/alt_text_generator.module
    --------------------------------------------------------------------------------
    FOUND 5 ERRORS AND 1 WARNING AFFECTING 5 LINES
    --------------------------------------------------------------------------------
     10 | WARNING | [x] Unused use statement
     26 | ERROR   | [x] Whitespace found at end of line
     31 | ERROR   | [x] Whitespace found at end of line
     32 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
     53 | ERROR   | [x] Expected 1 newline at end of file; 0 found
     53 | ERROR   | [x] Whitespace found at end of line
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    FILE: /home/vishalkadam/DRUPAL-CONTRIBUTE/alt_text_generator/alt_text_generator.libraries.yml
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     16 | ERROR | [x] Expected 1 newline at end of file; 0 found
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    FILE: /home/vishalkadam/DRUPAL-CONTRIBUTE/alt_text_generator/alt_text_generator.info.yml
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     8 | ERROR | [x] Expected 1 newline at end of file; 0 found
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    FILE: /home/vishalkadam/DRUPAL-CONTRIBUTE/alt_text_generator/alt_text_generator.routing.yml
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    v
     18 | ERROR | [x] Expected 1 newline at end of file; 0 found
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------

    Note: It is better to enable GitLab CI for the project and fix the PHP_CodeSniffer errors/warnings it reports.

    vishal.kadam’s picture

    Priority: Normal » Minor

    I am changing priority as per Issue priorities.

    avpaderno’s picture

    This thread has been idle, in the needs work state with no activity for some months.

    May you confirm you are still pursuing this application? If this is the case, and you made commits basing on what previously reported, or you can answer the questions previously asked, please change the status to Needs review.

    avpaderno’s picture

    Status: Needs work » Closed (won't fix)

    This thread has been idle, in the Needs work state with no activity for about six months or more; the application has been created about 11 months ago or more. Therefore, I marked it as Closed (won't fix).

    If this is incorrect, and you are still pursuing this application, please feel free to re-open it and set the issue status to Needs work or Needs review, depending on the current status of your code.

    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.