All core shipped image styles should include webp conversion

Created on 5 December 2023, 12 months ago
Updated 28 February 2024, 9 months ago

Problem/Motivation

Follow-up from ๐Ÿ“Œ Add webp image conversion to core's install profile's image style Fixed which didn't actually do what the issue summary suggested.

We should add a webp image conversion to all shipped image styles with core install profiles.

Steps to reproduce

NA

Proposed resolution

add a webp image conversion to all shipped image styles

Remaining tasks

Update remaining styles
Review

User interface changes

NA

API changes

NA

Data model changes

NA

Release notes snippet

NA

๐Ÿ“Œ Task
Status

Fixed

Version

11.0 ๐Ÿ”ฅ

Component
Baseย  โ†’

Last updated about 10 hours ago

Created by

๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom catch

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

Merge Requests

Comments & Activities

  • Issue created by @catch
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States jastraat

    Quick clarifying questions on this one:

    Should the convert to webp also be added to the default config from the Drupal core image module? (That would include the large, medium, thumbnail, etc styles.)

    And is this truly just to add something like the following as an additional entry in the "effects" section of all image.style.*.yml files in core install profiles?

        e037ec38-0f1e-425b-90f2-a80e622df793:
        uuid: e037ec38-0f1e-425b-90f2-a80e622df793
        id: image_convert
        weight: 2
        data:
          extension: webp
    
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance andypost

    Yes, amd it should be the last effect

  • ๐Ÿ‡ซ๐Ÿ‡ทFrance andypost
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom catch

    @jastraat yes makes sense to do those here too, I updated the issue title.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia prashant.c Dharamshala

    Can you provide guidance on where to implement these modifications? Are they intended to be made within the image.style.[name].yml files located inside profile config files? For instance, in the case of Umami, would these changes be applied in files such as core/profiles/demo_umami/config/install/image.style.large_3_2_2x.yml, as well as other relevant image style configuration files? Thank you.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia deepak.cms

    @catch, I added the WEBP image effect to default styles that comes with Standard Installation from image module.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom catch

    @deepak.cms - that looks fine. Can you also apply the same thing to the Umami install profile image styles? It would also be good to use an MR rather than a patch here (Drupal.org is moving away from patches).

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia deepak.cms

    Sure, I will update it in MR. Thanks

  • Assigned to deepak.cms
  • Status changed to Needs work 12 months ago
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom catch

    Sounds good - moving to needs work since there's already some code here.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia deepak.cms

    @catch, MR created please review.

  • Status changed to Needs review 12 months ago
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom catch
  • Status changed to Needs work 11 months ago
  • ๐Ÿ‡ต๐Ÿ‡ชPeru marvil07

    CI reports some errors at ConfigSchemaTest and ResponsiveImageFieldDisplayTest tests.
    Both of them seem to be relevant, so moving to NW.

    Several of them may be about actually changing the test, that was assuming a different context, like the png string match.

    Copying here the relevant output from each of them in CI output.

    ---- Drupal\KernelTests\Core\Config\ConfigSchemaTest ----
    
    
    Status    Group      Filename          Line Function                            
    --------------------------------------------------------------------------------
    Fail      Other      phpunit-175.xml      0 Drupal\KernelTests\Core\Config\Conf
        PHPUnit Test failed to complete; Error: PHPUnit 9.6.15 by Sebastian
    Bergmann and contributors.
    
    Testing Drupal\KernelTests\Core\Config\ConfigSchemaTest
    ..F........                                                       11 / 11
    (100%)
    
    Time: 00:12.394, Memory: 4.00 MB
    
    There was 1 failure:
    
    1) Drupal\KernelTests\Core\Config\ConfigSchemaTest::testSchemaData
    Got an array with effects for image.style.large data
    Failed asserting that actual size 2 matches expected size 1.
    
    /builds/issue/drupal-3406267/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php:121
    /builds/issue/drupal-3406267/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php:55
    /builds/issue/drupal-3406267/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php:360
    /builds/issue/drupal-3406267/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
    
    FAILURES!
    Tests: 11, Assertions: 74, Failures: 1.
    
    ---- Drupal\Tests\responsive_image\Functional\ResponsiveImageFieldDisplayTest ----
    
    
    Status    Group      Filename          Line Function
    --------------------------------------------------------------------------------
    Exception Other      phpunit-3.xml        0 Drupal\Tests\responsive_image\Funct
       PHPUnit Test failed to complete; Error: PHPUnit 9.6.15 by Sebastian
    Bergmann and contributors.
    
    Testing
    Drupal\Tests\responsive_image\Functional\ResponsiveImageFieldDisplayTest
    EE....E                                                             7 / 7
    (100%)
    
    Time: 01:04.705, Memory: 4.00 MB
    
    There were 3 errors:
    
    1)
    Drupal\Tests\responsive_image\Functional\ResponsiveImageFieldDisplayTest::testResponsiveImageFieldFormattersPublic
    Behat\Mink\Exception\ExpectationException: The string "type="image/png""
    was not found anywhere in the HTML response of the current page.
    
    /builds/issue/drupal-3406267/vendor/behat/mink/src/WebAssert.php:794
    /builds/issue/drupal-3406267/vendor/behat/mink/src/WebAssert.php:324
    /builds/issue/drupal-3406267/core/tests/Drupal/Tests/WebAssert.php:540
    /builds/issue/drupal-3406267/core/modules/responsive_image/tests/src/Functional/ResponsiveImageFieldDisplayTest.php:333
    /builds/issue/drupal-3406267/core/modules/responsive_image/tests/src/Functional/ResponsiveImageFieldDisplayTest.php:93
    /builds/issue/drupal-3406267/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
    
    2)
    Drupal\Tests\responsive_image\Functional\ResponsiveImageFieldDisplayTest::testResponsiveImageFieldFormattersPrivate
    Behat\Mink\Exception\ExpectationException: The string "type="image/png""
    was not found anywhere in the HTML response of the current page.
    
    /builds/issue/drupal-3406267/vendor/behat/mink/src/WebAssert.php:794
    /builds/issue/drupal-3406267/vendor/behat/mink/src/WebAssert.php:324
    /builds/issue/drupal-3406267/core/tests/Drupal/Tests/WebAssert.php:540
    /builds/issue/drupal-3406267/core/modules/responsive_image/tests/src/Functional/ResponsiveImageFieldDisplayTest.php:333
    /builds/issue/drupal-3406267/core/modules/responsive_image/tests/src/Functional/ResponsiveImageFieldDisplayTest.php:103
    /builds/issue/drupal-3406267/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
    
    3)
    Drupal\Tests\responsive_image\Functional\ResponsiveImageFieldDisplayTest::testResponsiveImageFieldFormattersMultipleSources
    Behat\Mink\Exception\ExpectationException: The pattern /\s+\s+\s+\s+/ was
    not found anywhere in the HTML response of the page.
    
    /builds/issue/drupal-3406267/vendor/behat/mink/src/WebAssert.php:794
    /builds/issue/drupal-3406267/vendor/behat/mink/src/WebAssert.php:354
    /builds/issue/drupal-3406267/core/modules/responsive_image/tests/src/Functional/ResponsiveImageFieldDisplayTest.php:509
    /builds/issue/drupal-3406267/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
    
    ERRORS!
    Tests: 7, Assertions: 187, Errors: 3.
    
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia deepak.cms

    Hi @marvil07,

    I updated the test cases for two image effects in the default styles. Please review it again.

    Thanks

  • Status changed to Needs review 11 months ago
  • Status changed to Needs work 11 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Surprised tests passed but donโ€™t believe we should be shipping config with uuids.

  • Status changed to Needs review 11 months ago
  • ๐Ÿ‡ช๐Ÿ‡ธSpain nireneko

    @smustgrave Checking the current config files (https://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/image... and https://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/image... for example) the uuids of the image effects are there, I'd say it's ok.

  • Status changed to Needs work 11 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Missing some updates

    There's an image.style in
    media_library
    demo_umami/optional
    standard profile

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia deepak.cms

    Hi @smustgrave,

    Updated all image styles. Please review again.

    Thanks

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia djsagar
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom catch

    This doesn't need tests, it's just a change to the default config.

  • Status changed to Needs review 11 months ago
  • Status changed to Needs work 11 months ago
  • The Needs Review Queue Bot โ†’ tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

    This does not mean that the patch needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

    Consult the Drupal Contributor Guide โ†’ to find step-by-step guides for working with issues.

  • Status changed to Needs review 10 months ago
  • Status changed to Needs work 10 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Current MR has failures.

  • First commit to issue fork.
  • ๐Ÿ‡ท๐Ÿ‡บRussia kostyashupenko Omsk

    Seems rebase didn't help. After local investigation also no results. No errors on spellcheck. Can you guide me if you will have an ability to fix it - what was a cause of it?

  • ๐Ÿ‡ท๐Ÿ‡บRussia kostyashupenko Omsk

    CI reports in spellcheck job is not so informative

  • Issue was unassigned.
  • Status changed to Needs review 10 months ago
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance andypost

    I started new pipeline and it passed, also extended core/profiles/standard/tests/src/Functional/StandardTest.php test for shipped effects

    As the #23 said no reason for test, I still sure standard profile needs at least this small addition

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    https://www.drupal.org/project/drupal/issues/3401988#comment-15402750 ๐Ÿ› Spell-checking job fails with "Argument list too long" when too many files are changed Active

    A workaround was posted here.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    smustgrave โ†’ changed the visibility of the branch 11.x to hidden.

  • Status changed to RTBC 10 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    New pipeline seemed to do the trick. Believe all feedback has been addressed

  • Status changed to Needs review 9 months ago
  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone

    I'm triaging RTBC issues โ†’ . I read the IS and the comments. I didn't find any unanswered questions.

    I read the MR and I don't have any questions. I then applied the diff and searched core to ensure that all image styles are updated.

    $ find . -iname image.style\*  | sed -e "s/.\///" | sort -u > core.out
    $ git status | grep image.style | awk '{print $2}' | sort -u   >  mr.out
    $ diff mr.out core.out
    4a5
    > core/modules/image/help_topics/image.style.html.twig
    13a15,19
    > core/profiles/demo_umami/config/install/image.style.scale_crop_7_3_large.yml
    > core/profiles/demo_umami/config/install/image.style.scale_crop_7_3_medium.yml
    > core/profiles/demo_umami/config/install/image.style.scale_crop_7_3_small.yml
    > core/profiles/demo_umami/config/install/image.style.scale_crop_7_3_tiny.yml
    > core/profiles/demo_umami/config/install/image.style.scale_crop_7_3_wide.yml
    

    Why are these files not changes?

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    @quietone those already contain the code

    Example > core/profiles/demo_umami/config/install/image.style.scale_crop_7_3_small.yml

      d5eb26a0-f961-4ba4-9f01-94a44440b4fa:
        uuid: d5eb26a0-f961-4ba4-9f01-94a44440b4fa
        id: image_convert
        weight: 2
        data:
          extension: webp
    
  • Status changed to RTBC 9 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Restoring status.

    • catch โ†’ committed 4a64e1ab on 11.x
      Issue #3406267 by deepak.cms, andypost, kostyashupenko, smustgrave,...
  • Status changed to Fixed 9 months ago
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom catch

    Added a change record; https://www.drupal.org/node/3421405 โ†’ and committed/pushed to 11.x, thanks!

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom longwave UK

    Nice work, tagging this as a highlight for the release announcement.

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

Production build 0.71.5 2024