From 4a64e1abf3c1ace1adc28d8a85fca4a2224969f2 Mon Sep 17 00:00:00 2001
From: catch <catch@35733.no-reply.drupal.org>
Date: Wed, 14 Feb 2024 14:59:45 +0000
Subject: [PATCH] Issue #3406267 by deepak.cms, andypost, kostyashupenko,
 smustgrave, catch, marvil07, nireneko, quietone: All core shipped image
 styles should include webp conversion

---
 .../config/install/image.style.large.yml      |  6 +++++
 .../config/install/image.style.medium.yml     |  6 +++++
 .../config/install/image.style.thumbnail.yml  |  6 +++++
 .../image/config/install/image.style.wide.yml |  6 +++++
 .../install/image.style.media_library.yml     |  6 +++++
 .../ResponsiveImageFieldDisplayTest.php       |  4 ++--
 .../config/install/image.style.large_21_9.yml |  6 +++++
 .../install/image.style.large_21_9_2x.yml     |  6 +++++
 .../install/image.style.large_3_2_2x.yml      |  6 +++++
 .../install/image.style.large_3_2_768x512.yml |  6 +++++
 .../install/image.style.medium_21_9.yml       |  6 +++++
 .../install/image.style.medium_3_2_2x.yml     |  6 +++++
 .../image.style.medium_3_2_600x400.yml        |  6 +++++
 .../config/install/image.style.medium_8_7.yml |  6 +++++
 .../config/install/image.style.small_21_9.yml |  6 +++++
 .../install/image.style.square_large.yml      |  6 +++++
 .../install/image.style.square_medium.yml     |  6 +++++
 .../install/image.style.square_small.yml      |  6 +++++
 .../optional/image.style.max_1300x1300.yml    |  6 +++++
 .../optional/image.style.max_2600x2600.yml    |  6 +++++
 .../optional/image.style.max_325x325.yml      |  6 +++++
 .../optional/image.style.max_650x650.yml      |  6 +++++
 .../optional/image.style.max_1300x1300.yml    |  6 +++++
 .../optional/image.style.max_2600x2600.yml    |  8 ++++++-
 .../optional/image.style.max_325x325.yml      |  6 +++++
 .../optional/image.style.max_650x650.yml      |  6 +++++
 .../tests/src/Functional/StandardTest.php     |  9 ++++++++
 .../Core/Config/ConfigSchemaTest.php          | 22 +++++++++++++------
 28 files changed, 177 insertions(+), 10 deletions(-)

diff --git a/core/modules/image/config/install/image.style.large.yml b/core/modules/image/config/install/image.style.large.yml
index c7935849a93b..e0b8394552e3 100644
--- a/core/modules/image/config/install/image.style.large.yml
+++ b/core/modules/image/config/install/image.style.large.yml
@@ -12,3 +12,9 @@ effects:
       width: 480
       height: 480
       upscale: false
+  6e8fe467-84c1-4ef0-a73b-7eccf1cc20e8:
+    uuid: 6e8fe467-84c1-4ef0-a73b-7eccf1cc20e8
+    id: image_convert
+    weight: 2
+    data:
+      extension: webp
diff --git a/core/modules/image/config/install/image.style.medium.yml b/core/modules/image/config/install/image.style.medium.yml
index 775a511b0c1d..f096610c6593 100644
--- a/core/modules/image/config/install/image.style.medium.yml
+++ b/core/modules/image/config/install/image.style.medium.yml
@@ -12,3 +12,9 @@ effects:
       width: 220
       height: 220
       upscale: false
+  c410ed2f-aa30-4d9c-a224-d2865d9188cd:
+    uuid: c410ed2f-aa30-4d9c-a224-d2865d9188cd
+    id: image_convert
+    weight: 2
+    data:
+      extension: webp
diff --git a/core/modules/image/config/install/image.style.thumbnail.yml b/core/modules/image/config/install/image.style.thumbnail.yml
index 73dc9b85c2bf..c03c60e00e27 100644
--- a/core/modules/image/config/install/image.style.thumbnail.yml
+++ b/core/modules/image/config/install/image.style.thumbnail.yml
@@ -12,3 +12,9 @@ effects:
       width: 100
       height: 100
       upscale: false
+  c4eb9942-2c9e-4a81-949f-6161a44b6559:
+    uuid: c4eb9942-2c9e-4a81-949f-6161a44b6559
+    id: image_convert
+    weight: 2
+    data:
+      extension: webp
diff --git a/core/modules/image/config/install/image.style.wide.yml b/core/modules/image/config/install/image.style.wide.yml
index ede2f793f94a..8573ae26346f 100644
--- a/core/modules/image/config/install/image.style.wide.yml
+++ b/core/modules/image/config/install/image.style.wide.yml
@@ -12,3 +12,9 @@ effects:
       width: 1090
       height: null
       upscale: false
+  294c5f76-42a4-43ce-82c2-81c2f4723da0:
+    uuid: 294c5f76-42a4-43ce-82c2-81c2f4723da0
+    id: image_convert
+    weight: 2
+    data:
+      extension: webp
diff --git a/core/modules/media_library/config/install/image.style.media_library.yml b/core/modules/media_library/config/install/image.style.media_library.yml
index f1acd3b6c98c..5da64cfdcc36 100644
--- a/core/modules/media_library/config/install/image.style.media_library.yml
+++ b/core/modules/media_library/config/install/image.style.media_library.yml
@@ -15,3 +15,9 @@ effects:
       width: 220
       height: 220
       upscale: false
+  1021da71-fc2a-43d0-be5d-efaf1c79e2ea:
+    uuid: 1021da71-fc2a-43d0-be5d-efaf1c79e2ea
+    id: image_convert
+    weight: 2
+    data:
+      extension: webp
diff --git a/core/modules/responsive_image/tests/src/Functional/ResponsiveImageFieldDisplayTest.php b/core/modules/responsive_image/tests/src/Functional/ResponsiveImageFieldDisplayTest.php
index ccf3c9577ae0..ef7a064fbffa 100644
--- a/core/modules/responsive_image/tests/src/Functional/ResponsiveImageFieldDisplayTest.php
+++ b/core/modules/responsive_image/tests/src/Functional/ResponsiveImageFieldDisplayTest.php
@@ -330,7 +330,7 @@ protected function doTestResponsiveImageFieldFormatters($scheme, $empty_styles =
     if (!$empty_styles) {
       $this->assertSession()->responseHeaderContains('X-Drupal-Cache-Tags', 'config:image.style.medium');
       $this->assertSession()->responseHeaderContains('X-Drupal-Cache-Tags', 'config:image.style.thumbnail');
-      $this->assertSession()->responseContains('type="image/png"');
+      $this->assertSession()->responseContains('type="image/webp"');
     }
     $this->assertSession()->responseHeaderContains('X-Drupal-Cache-Tags', 'config:image.style.large');
 
@@ -506,7 +506,7 @@ public function testResponsiveImageFieldFormattersMultipleSources() {
 
     // Assert the picture tag has source tags that include dimensions.
     $this->drupalGet('node/' . $nid);
-    $this->assertSession()->responseMatches('/<picture>\s+<source srcset="' . \preg_quote($large_transform_url, '/') . ' 1x" media="\(min-width: 851px\)" type="image\/png" width="480" height="480"\/>\s+<source srcset="' . \preg_quote($medium_transform_url, '/') . ' 1x, ' . \preg_quote($large_transform_url, '/') . ' 1.5x, ' . \preg_quote($large_transform_url, '/') . ' 2x" type="image\/png" width="220" height="220"\/>\s+<img loading="eager" src="' . \preg_quote($large_transform_url, '/') . '" width="480" height="480" alt="\w+" \/>\s+<\/picture>/');
+    $this->assertSession()->responseMatches('/<picture>\s+<source srcset="' . \preg_quote($large_transform_url, '/') . ' 1x" media="\(min-width: 851px\)" type="image\/webp" width="480" height="480"\/>\s+<source srcset="' . \preg_quote($medium_transform_url, '/') . ' 1x, ' . \preg_quote($large_transform_url, '/') . ' 1.5x, ' . \preg_quote($large_transform_url, '/') . ' 2x" type="image\/webp" width="220" height="220"\/>\s+<img loading="eager" src="' . \preg_quote($large_transform_url, '/') . '" width="480" height="480" alt="\w+" \/>\s+<\/picture>/');
   }
 
   /**
diff --git a/core/profiles/demo_umami/config/install/image.style.large_21_9.yml b/core/profiles/demo_umami/config/install/image.style.large_21_9.yml
index da059b013d55..562912c5af90 100644
--- a/core/profiles/demo_umami/config/install/image.style.large_21_9.yml
+++ b/core/profiles/demo_umami/config/install/image.style.large_21_9.yml
@@ -12,3 +12,9 @@ effects:
       width: 1440
       height: 620
       anchor: center-center
+  622f10ec-5f36-427e-a54a-4c0b8a45d6ab:
+    uuid: 622f10ec-5f36-427e-a54a-4c0b8a45d6ab
+    id: image_convert
+    weight: 2
+    data:
+      extension: webp
diff --git a/core/profiles/demo_umami/config/install/image.style.large_21_9_2x.yml b/core/profiles/demo_umami/config/install/image.style.large_21_9_2x.yml
index 82324faa8bef..92a413cec5df 100644
--- a/core/profiles/demo_umami/config/install/image.style.large_21_9_2x.yml
+++ b/core/profiles/demo_umami/config/install/image.style.large_21_9_2x.yml
@@ -12,3 +12,9 @@ effects:
       width: 2880
       height: 1240
       anchor: center-center
+  20ec38fa-1f1c-422d-9fed-48ed96e3eb50:
+    uuid: 20ec38fa-1f1c-422d-9fed-48ed96e3eb50
+    id: image_convert
+    weight: 2
+    data:
+      extension: webp
diff --git a/core/profiles/demo_umami/config/install/image.style.large_3_2_2x.yml b/core/profiles/demo_umami/config/install/image.style.large_3_2_2x.yml
index 973194caad8c..9163a56dcae5 100644
--- a/core/profiles/demo_umami/config/install/image.style.large_3_2_2x.yml
+++ b/core/profiles/demo_umami/config/install/image.style.large_3_2_2x.yml
@@ -12,3 +12,9 @@ effects:
       width: 1536
       height: 1024
       anchor: center-center
+  3363b685-9a5f-4bd8-9246-1ad117054988:
+    uuid: 3363b685-9a5f-4bd8-9246-1ad117054988
+    id: image_convert
+    weight: 2
+    data:
+      extension: webp
diff --git a/core/profiles/demo_umami/config/install/image.style.large_3_2_768x512.yml b/core/profiles/demo_umami/config/install/image.style.large_3_2_768x512.yml
index d2e66b3e7b1c..30c456805156 100644
--- a/core/profiles/demo_umami/config/install/image.style.large_3_2_768x512.yml
+++ b/core/profiles/demo_umami/config/install/image.style.large_3_2_768x512.yml
@@ -12,3 +12,9 @@ effects:
       width: 768
       height: 512
       anchor: center-center
+  11b52bd1-8d1a-4e61-9578-3a3a290760a2:
+    uuid: 11b52bd1-8d1a-4e61-9578-3a3a290760a2
+    id: image_convert
+    weight: 2
+    data:
+      extension: webp
diff --git a/core/profiles/demo_umami/config/install/image.style.medium_21_9.yml b/core/profiles/demo_umami/config/install/image.style.medium_21_9.yml
index 0c4c28944fff..aea540821828 100644
--- a/core/profiles/demo_umami/config/install/image.style.medium_21_9.yml
+++ b/core/profiles/demo_umami/config/install/image.style.medium_21_9.yml
@@ -12,3 +12,9 @@ effects:
       width: 1024
       height: 440
       anchor: center-center
+  dd8d02b0-2ae5-4e0c-988f-730711911c49:
+    uuid: dd8d02b0-2ae5-4e0c-988f-730711911c49
+    id: image_convert
+    weight: 2
+    data:
+      extension: webp
diff --git a/core/profiles/demo_umami/config/install/image.style.medium_3_2_2x.yml b/core/profiles/demo_umami/config/install/image.style.medium_3_2_2x.yml
index 61e911f4386c..365c7ff976bb 100644
--- a/core/profiles/demo_umami/config/install/image.style.medium_3_2_2x.yml
+++ b/core/profiles/demo_umami/config/install/image.style.medium_3_2_2x.yml
@@ -12,3 +12,9 @@ effects:
       width: 1200
       height: 800
       anchor: center-center
+  1d1dd894-df16-49b4-8433-0a41624ccde2:
+    uuid: 1d1dd894-df16-49b4-8433-0a41624ccde2
+    id: image_convert
+    weight: 2
+    data:
+      extension: webp
diff --git a/core/profiles/demo_umami/config/install/image.style.medium_3_2_600x400.yml b/core/profiles/demo_umami/config/install/image.style.medium_3_2_600x400.yml
index 6de2dcafc0d9..4c9a7416a859 100644
--- a/core/profiles/demo_umami/config/install/image.style.medium_3_2_600x400.yml
+++ b/core/profiles/demo_umami/config/install/image.style.medium_3_2_600x400.yml
@@ -12,3 +12,9 @@ effects:
       width: 600
       height: 400
       anchor: center-center
+  cdd80cc9-5ecc-4040-9d83-a271c5142b7d:
+    uuid: cdd80cc9-5ecc-4040-9d83-a271c5142b7d
+    id: image_convert
+    weight: 2
+    data:
+      extension: webp
diff --git a/core/profiles/demo_umami/config/install/image.style.medium_8_7.yml b/core/profiles/demo_umami/config/install/image.style.medium_8_7.yml
index 7ec98a6f7fc3..f1abccdbc117 100644
--- a/core/profiles/demo_umami/config/install/image.style.medium_8_7.yml
+++ b/core/profiles/demo_umami/config/install/image.style.medium_8_7.yml
@@ -12,3 +12,9 @@ effects:
       width: 266
       height: 236
       anchor: center-center
+  622134fc-29c1-43d4-ba34-beffc0bc4e15:
+    uuid: 622134fc-29c1-43d4-ba34-beffc0bc4e15
+    id: image_convert
+    weight: 2
+    data:
+      extension: webp
diff --git a/core/profiles/demo_umami/config/install/image.style.small_21_9.yml b/core/profiles/demo_umami/config/install/image.style.small_21_9.yml
index 81f3c7ca9042..448c2bbc9a04 100644
--- a/core/profiles/demo_umami/config/install/image.style.small_21_9.yml
+++ b/core/profiles/demo_umami/config/install/image.style.small_21_9.yml
@@ -12,3 +12,9 @@ effects:
       width: 768
       height: 330
       anchor: center-center
+  f4f34147-c147-4e51-a7e2-5334f5ddb6f7:
+    uuid: f4f34147-c147-4e51-a7e2-5334f5ddb6f7
+    id: image_convert
+    weight: 2
+    data:
+      extension: webp
diff --git a/core/profiles/demo_umami/config/install/image.style.square_large.yml b/core/profiles/demo_umami/config/install/image.style.square_large.yml
index 5a1ada29bf63..c395c1d660c8 100644
--- a/core/profiles/demo_umami/config/install/image.style.square_large.yml
+++ b/core/profiles/demo_umami/config/install/image.style.square_large.yml
@@ -12,3 +12,9 @@ effects:
       width: 900
       height: 900
       anchor: center-center
+  54c8c29a-0a39-4ff0-b61b-8e85cc9367a4:
+    uuid: 54c8c29a-0a39-4ff0-b61b-8e85cc9367a4
+    id: image_convert
+    weight: 2
+    data:
+      extension: webp
diff --git a/core/profiles/demo_umami/config/install/image.style.square_medium.yml b/core/profiles/demo_umami/config/install/image.style.square_medium.yml
index a4bce4f9fce6..958180a249bf 100644
--- a/core/profiles/demo_umami/config/install/image.style.square_medium.yml
+++ b/core/profiles/demo_umami/config/install/image.style.square_medium.yml
@@ -12,3 +12,9 @@ effects:
       width: 600
       height: 600
       anchor: center-center
+  b39ee1dd-ee27-4219-ba5d-e49d973f6b0f:
+    uuid: b39ee1dd-ee27-4219-ba5d-e49d973f6b0f
+    id: image_convert
+    weight: 2
+    data:
+      extension: webp
diff --git a/core/profiles/demo_umami/config/install/image.style.square_small.yml b/core/profiles/demo_umami/config/install/image.style.square_small.yml
index 50a859fd2b7d..387807631127 100644
--- a/core/profiles/demo_umami/config/install/image.style.square_small.yml
+++ b/core/profiles/demo_umami/config/install/image.style.square_small.yml
@@ -12,3 +12,9 @@ effects:
       width: 300
       height: 300
       anchor: center-center
+  dc9608c0-7510-4fbf-9474-028565687572:
+    uuid: dc9608c0-7510-4fbf-9474-028565687572
+    id: image_convert
+    weight: 2
+    data:
+      extension: webp
diff --git a/core/profiles/demo_umami/config/optional/image.style.max_1300x1300.yml b/core/profiles/demo_umami/config/optional/image.style.max_1300x1300.yml
index 28aad5aadab6..ec9723761fb0 100644
--- a/core/profiles/demo_umami/config/optional/image.style.max_1300x1300.yml
+++ b/core/profiles/demo_umami/config/optional/image.style.max_1300x1300.yml
@@ -15,3 +15,9 @@ effects:
       width: 1300
       height: 1300
       upscale: false
+  45c1e8e2-700e-4300-b0b8-c219e91d256b:
+    uuid: 45c1e8e2-700e-4300-b0b8-c219e91d256b
+    id: image_convert
+    weight: 2
+    data:
+      extension: webp
diff --git a/core/profiles/demo_umami/config/optional/image.style.max_2600x2600.yml b/core/profiles/demo_umami/config/optional/image.style.max_2600x2600.yml
index ace3a8a49239..27e9f72aa34e 100644
--- a/core/profiles/demo_umami/config/optional/image.style.max_2600x2600.yml
+++ b/core/profiles/demo_umami/config/optional/image.style.max_2600x2600.yml
@@ -15,3 +15,9 @@ effects:
       width: 2600
       height: 2600
       upscale: false
+  ecb160c9-df96-4b0b-9ef8-8ac74dd319f8:
+    uuid: ecb160c9-df96-4b0b-9ef8-8ac74dd319f8
+    id: image_convert
+    weight: 2
+    data:
+      extension: webp
diff --git a/core/profiles/demo_umami/config/optional/image.style.max_325x325.yml b/core/profiles/demo_umami/config/optional/image.style.max_325x325.yml
index 6a2289e76a81..177af88aaccf 100644
--- a/core/profiles/demo_umami/config/optional/image.style.max_325x325.yml
+++ b/core/profiles/demo_umami/config/optional/image.style.max_325x325.yml
@@ -15,3 +15,9 @@ effects:
       width: 325
       height: 325
       upscale: false
+  317b3f98-979a-4ee6-adec-fd24c7c7332c:
+    uuid: 317b3f98-979a-4ee6-adec-fd24c7c7332c
+    id: image_convert
+    weight: 2
+    data:
+      extension: webp
diff --git a/core/profiles/demo_umami/config/optional/image.style.max_650x650.yml b/core/profiles/demo_umami/config/optional/image.style.max_650x650.yml
index 9aa0fb5fc844..f941bb186483 100644
--- a/core/profiles/demo_umami/config/optional/image.style.max_650x650.yml
+++ b/core/profiles/demo_umami/config/optional/image.style.max_650x650.yml
@@ -15,3 +15,9 @@ effects:
       width: 650
       height: 650
       upscale: false
+  a4968ae1-83ac-420c-8e81-c571209daa44:
+    uuid: a4968ae1-83ac-420c-8e81-c571209daa44
+    id: image_convert
+    weight: 2
+    data:
+      extension: webp
diff --git a/core/profiles/standard/config/optional/image.style.max_1300x1300.yml b/core/profiles/standard/config/optional/image.style.max_1300x1300.yml
index 9a72789c8495..fde3282498d0 100644
--- a/core/profiles/standard/config/optional/image.style.max_1300x1300.yml
+++ b/core/profiles/standard/config/optional/image.style.max_1300x1300.yml
@@ -16,3 +16,9 @@ effects:
       width: 1300
       height: 1300
       upscale: false
+  e8c9d6ba-a017-4a87-9999-7ce52e138e1d:
+    uuid: e8c9d6ba-a017-4a87-9999-7ce52e138e1d
+    id: image_convert
+    weight: 2
+    data:
+      extension: webp
diff --git a/core/profiles/standard/config/optional/image.style.max_2600x2600.yml b/core/profiles/standard/config/optional/image.style.max_2600x2600.yml
index 9754e2f925cb..a63e72ab6f35 100644
--- a/core/profiles/standard/config/optional/image.style.max_2600x2600.yml
+++ b/core/profiles/standard/config/optional/image.style.max_2600x2600.yml
@@ -11,8 +11,14 @@ effects:
   9b311dd1-0351-45a1-9500-cd069e4670cb:
     uuid: 9b311dd1-0351-45a1-9500-cd069e4670cb
     id: image_scale
-    weight: 3
+    weight: 1
     data:
       width: 2600
       height: 2600
       upscale: false
+  3c42f186-7beb-4dbf-b720-bff9dfeaa677:
+    uuid: 3c42f186-7beb-4dbf-b720-bff9dfeaa677
+    id: image_convert
+    weight: 2
+    data:
+      extension: webp
diff --git a/core/profiles/standard/config/optional/image.style.max_325x325.yml b/core/profiles/standard/config/optional/image.style.max_325x325.yml
index e6bc09b25f57..e820c8bb01da 100644
--- a/core/profiles/standard/config/optional/image.style.max_325x325.yml
+++ b/core/profiles/standard/config/optional/image.style.max_325x325.yml
@@ -16,3 +16,9 @@ effects:
       width: 325
       height: 325
       upscale: false
+  f2b6c795-26ae-4130-aa18-aa120ea3ba98:
+    uuid: f2b6c795-26ae-4130-aa18-aa120ea3ba98
+    id: image_convert
+    weight: 2
+    data:
+      extension: webp
diff --git a/core/profiles/standard/config/optional/image.style.max_650x650.yml b/core/profiles/standard/config/optional/image.style.max_650x650.yml
index 87b47f784a92..d5beda6259f3 100644
--- a/core/profiles/standard/config/optional/image.style.max_650x650.yml
+++ b/core/profiles/standard/config/optional/image.style.max_650x650.yml
@@ -16,3 +16,9 @@ effects:
       width: 650
       height: 650
       upscale: false
+  4a2a7af8-8ea3-419d-b5f8-256d57016102:
+    uuid: 4a2a7af8-8ea3-419d-b5f8-256d57016102
+    id: image_convert
+    weight: 2
+    data:
+      extension: webp
diff --git a/core/profiles/standard/tests/src/Functional/StandardTest.php b/core/profiles/standard/tests/src/Functional/StandardTest.php
index 1b0a1d26af7f..097bf9e61fda 100644
--- a/core/profiles/standard/tests/src/Functional/StandardTest.php
+++ b/core/profiles/standard/tests/src/Functional/StandardTest.php
@@ -5,6 +5,7 @@
 use Drupal\ckeditor5\Plugin\Editor\CKEditor5;
 use Drupal\Component\Utility\Html;
 use Drupal\editor\Entity\Editor;
+use Drupal\image\Entity\ImageStyle;
 use Drupal\media\Entity\MediaType;
 use Drupal\media\Plugin\media\Source\Image;
 use Drupal\Tests\SchemaCheckTestTrait;
@@ -191,6 +192,14 @@ function (ConstraintViolation $v) {
     $this->assertSession()->pageTextContains('Max 1300x1300');
     $this->assertSession()->pageTextContains('Max 2600x2600');
 
+    // Make sure all image styles has webp conversion as last effect.
+    foreach (ImageStyle::loadMultiple() as $style) {
+      $effects = $style->getEffects()->getInstanceIds();
+      $last = $style->getEffects()->get(end($effects));
+      $this->assertSame('image_convert', $last->getConfiguration()['id']);
+      $this->assertSame('webp', $last->getConfiguration()['data']['extension']);
+    }
+
     // Verify certain routes' responses are cacheable by Dynamic Page Cache, to
     // ensure these responses are very fast for authenticated users.
     $this->drupalLogin($this->adminUser);
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php
index edef4e1f6c5f..5243cc4c5efe 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php
@@ -367,13 +367,21 @@ public function testSchemaData() {
     // Now let's try something more complex, with nested objects.
     $wrapper = \Drupal::service('config.typed')->get('image.style.large');
     $effects = $wrapper->get('effects');
-    $this->assertCount(1, $effects->toArray(), 'Got an array with effects for image.style.large data');
-    $uuid = key($effects->getValue());
-    $effect = $effects->get($uuid)->getElements();
-    $this->assertFalse($effect['data']->isEmpty(), 'Got data for the image scale effect from metadata.');
-    $this->assertSame('image_scale', $effect['id']->getValue(), 'Got data for the image scale effect from metadata.');
-    $this->assertInstanceOf(IntegerInterface::class, $effect['data']->get('width'));
-    $this->assertEquals(480, $effect['data']->get('width')->getValue(), 'Got the right value for the scale effect width.');
+    $this->assertCount(2, $effects->toArray(), 'Got an array with effects for image.style.large data');
+    foreach ($effects->toArray() as $uuid => $definition) {
+      $effect = $effects->get($uuid)->getElements();
+      if ($definition['id'] == 'image_scale') {
+        $this->assertFalse($effect['data']->isEmpty(), 'Got data for the image scale effect from metadata.');
+        $this->assertSame('image_scale', $effect['id']->getValue(), 'Got data for the image scale effect from metadata.');
+        $this->assertInstanceOf(IntegerInterface::class, $effect['data']->get('width'));
+        $this->assertEquals(480, $effect['data']->get('width')->getValue(), 'Got the right value for the scale effect width.');
+      }
+      if ($definition['id'] == 'image_convert') {
+        $this->assertFalse($effect['data']->isEmpty(), 'Got data for the image convert effect from metadata.');
+        $this->assertSame('image_convert', $effect['id']->getValue(), 'Got data for the image convert effect from metadata.');
+        $this->assertSame('webp', $effect['data']->get('extension')->getValue(), 'Got the right value for the convert effect extension.');
+      }
+    }
   }
 
   /**
-- 
GitLab