Change social_large image so that content shares images with high quality to social media like twitter and facebook

Created on 7 October 2020, over 3 years ago
Updated 9 April 2024, 3 months ago

From the metatags module:

The URL of an image which should represent the content. The image must be at least 200 x 200 pixels in size; 600 x 316 pixels is a recommended minimum size, and for best results use an image least 1200 x 630 pixels in size. Supports PNG, JPEG and GIF formats. Should not be used if og:image:url is used. Note: if multiple images are added many services (e.g. Facebook) will default to the largest image, not specifically the first one. Multiple values may be used, separated by a comma. Note: Tokens that return multiple values will be handled automatically. This will be able to extract the URL from an image field.

The problem: the social large image style has a maximum of 460. Let's use the recommended image size of 1200 x 630 in a smart crop so that it shares high quality images on social media.

--- a/config/sync/image.style.social_large.yml
+++ b/config/sync/image.style.social_large.yml
@@ -1,17 +1,21 @@
 uuid: 2a3c63a1-ab95-44a3-bbdc-49069144dc7e
 langcode: en
 status: true
-dependencies: {  }
+dependencies:
+  module:
+    - image_effects
 _core:
   default_config_hash: Vb4-kqRI38DonerDJI6WK5_ipT49wUoQTVdcipA6vo8
 name: social_large
 label: 'Social Large'
 effects:
-  7ad6b2fb-fbee-4a99-a3ea-50eee3d79ad1:
-    uuid: 7ad6b2fb-fbee-4a99-a3ea-50eee3d79ad1
-    id: image_scale
-    weight: 1
+  90fbf8d4-f99b-4196-9350-9e056fa3591c:
+    uuid: 90fbf8d4-f99b-4196-9350-9e056fa3591c
+    id: image_effects_scale_and_smart_crop
+    weight: 2
     data:
-      width: 460
-      height: 460
+      width: '1200'
+      height: '630'
       upscale: false
+      simulate: false
+      algorithm: entropy_slice
✨ Feature request
Status

Active

Version

6.0

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium Grayle

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024