Skip to content

Commit

Permalink
Merge pull request #19 from open-y-subprojects/webp
Browse files Browse the repository at this point in the history
feat: add webp for image styles
Addresses: https://openy.atlassian.net/browse/PRODDEV-369
  • Loading branch information
podarok authored Jan 20, 2022
2 parents 721c328 + ad5f181 commit 5aef451
Show file tree
Hide file tree
Showing 49 changed files with 321 additions and 16 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"ymcatwincities/openy": "*",
"open-y-subprojects/openy_node_alert": "^1.1.0",
"open-y-subprojects/openy_demo_content": "^1.0",
"ynorth-projects/openy_node_session": "^0.9 || ^1.1.0"
"ynorth-projects/openy_node_session": "^0.9 || ^1.1.0",
"drupal/core": "^9.2"
},
"license": "GPL-2.0+",
"minimum-stability": "dev"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ effects:
width: 2280
height: 2280
upscale: false
f633d730-2fea-43b1-9ce5-4b32e3fd7b54:
uuid: f633d730-2fea-43b1-9ce5-4b32e3fd7b54
id: image_convert
weight: 2
data:
extension: webp
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ effects:
width: 570
height: null
upscale: false
da79b7d8-2eaa-455d-a3cc-1c88a985efd5:
uuid: da79b7d8-2eaa-455d-a3cc-1c88a985efd5
id: image_convert
weight: 2
data:
extension: webp
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ effects:
width: null
height: 500
upscale: false
dda3c692-876e-4a94-984e-6b10fc52ee96:
uuid: dda3c692-876e-4a94-984e-6b10fc52ee96
id: image_convert
weight: 2
data:
extension: webp
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ effects:
width: 150
height: 150
anchor: center-center
78b8d329-631c-44ae-b517-dbde12f94c06:
uuid: 78b8d329-631c-44ae-b517-dbde12f94c06
id: image_convert
weight: 2
data:
extension: webp
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ effects:
width: 270
height: 200
anchor: center-center
4df2a608-78df-4218-a931-53d3ab1d7597:
uuid: 4df2a608-78df-4218-a931-53d3ab1d7597
id: image_convert
weight: 2
data:
extension: webp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 'Open Y Media Image'
description: 'Provides an Image media entity and features.'
type: module
core_version_requirement: ^8 || ^9
core_version_requirement: ^8 || ^9.2
version: 8.x-1.0
package: 'Open Y'
dependencies:
Expand Down
22 changes: 22 additions & 0 deletions openy_media/modules/openy_media_image/openy_media_image.install
Original file line number Diff line number Diff line change
Expand Up @@ -359,3 +359,25 @@ function openy_media_image_update_8014() {

$config->set('type_settings.display_plugins', $updated_view_modes)->save(TRUE);
}

/**
* Apply Webp to all image styles.
*/
function openy_media_image_update_8016() {
$path = \Drupal::service('extension.list.module')->getPath('openy_media_image') . '/config/install';
$config_importer = \Drupal::service('config_import.importer');
$config_importer->setDirectory($path);
$config_importer->importConfigs([
'image.style.media_full',
'image.style.media_half',
'image.style.thumbnail_focal_point',
'image.style.thumbnail_for_preview'
]);

$path = \Drupal::service('extension.list.module')->getPath('openy_media_image') . '/config/override';

$config_importer->setDirectory($path);
$config_importer->importConfigs([
'image.style.browser_thumbnail'
]);
}
6 changes: 6 additions & 0 deletions openy_node/config/install/image.style.facebook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ effects:
width: 600
height: 315
upscale: false
5cc7aae0-016e-4841-8ca9-556674060bf3:
uuid: 5cc7aae0-016e-4841-8ca9-556674060bf3
id: image_convert
weight: 2
data:
extension: webp
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@ effects:
width: 762
height: 451
crop_type: focal_point
46100baa-27d9-4a8a-b2f0-14d723b1ee78:
uuid: 46100baa-27d9-4a8a-b2f0-14d723b1ee78
id: image_convert
weight: 2
data:
extension: webp
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@ effects:
width: 362
height: 362
crop_type: focal_point
77e02ffa-70e5-4b24-a1a9-2f7ee09b3379:
uuid: 77e02ffa-70e5-4b24-a1a9-2f7ee09b3379
id: image_convert
weight: 2
data:
extension: webp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Open Y Node Blog
description: Provides a Blog content type and related configuration.
type: module
core_version_requirement: ^8 || ^9
core_version_requirement: ^8 || ^9.2
package: Open Y
version: 8.x-1.0
dependencies:
Expand Down
13 changes: 13 additions & 0 deletions openy_node/modules/openy_node_blog/openy_node_blog.install
Original file line number Diff line number Diff line change
Expand Up @@ -331,3 +331,16 @@ function openy_node_blog_update_8013() {
}
}
}

/**
* Apply Webp to all image styles.
*/
function openy_node_blog_update_8015() {
$path = \Drupal::service('extension.list.module')->getPath('openy_node_blog') . '/config/install';
$config_importer = \Drupal::service('config_import.importer');
$config_importer->setDirectory($path);
$config_importer->importConfigs([
'image.style.node_blog',
'image.style.node_blog_teaser'
]);
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@ effects:
width: 360
height: 300
crop_type: focal_point
a64c1c5c-104e-4806-b935-626a6d328710:
uuid: a64c1c5c-104e-4806-b935-626a6d328710
id: image_convert
weight: 2
data:
extension: webp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Open Y Node Program Subcategory
description: Provides a Program Subcategory content type and related configuration.
type: module
core_version_requirement: ^8 || ^9
core_version_requirement: ^8 || ^9.2
package: Open Y
version: 8.x-1.0
dependencies:
Expand Down
12 changes: 12 additions & 0 deletions openy_node/modules/openy_node_category/openy_node_category.install
Original file line number Diff line number Diff line change
Expand Up @@ -333,3 +333,15 @@ function openy_node_category_update_8015() {
}
}
}

/**
* Apply Webp to all image styles.
*/
function openy_node_category_update_8017() {
$path = \Drupal::service('extension.list.module')->getPath('openy_node_category') . '/config/install';
$config_importer = \Drupal::service('config_import.importer');
$config_importer->setDirectory($path);
$config_importer->importConfigs([
'image.style.node_program_subcategory_teaser'
]);
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,10 @@ effects:
data:
width: 266
height: 247
anchor: center-center
b643fcfd-02c5-416a-a2ea-d0f69b38b10d:
uuid: b643fcfd-02c5-416a-a2ea-d0f69b38b10d
id: image_convert
weight: 2
data:
extension: webp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Open Y Node Event
description: Provides an Event content type and related configuration.
type: module
package: Open Y
core_version_requirement: ^8 || ^9
core_version_requirement: ^8 || ^9.2
version: 8.x-1.0
dependencies:
- content_moderation:content_moderation
Expand Down
12 changes: 12 additions & 0 deletions openy_node/modules/openy_node_event/openy_node_event.install
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,15 @@ function openy_node_event_update_8001() {
}
}
}

/**
* Apply Webp to all image styles.
*/
function openy_node_event_update_8003() {
$path = \Drupal::service('extension.list.module')->getPath('openy_node_event') . '/config/install';
$config_importer = \Drupal::service('config_import.importer');
$config_importer->setDirectory($path);
$config_importer->importConfigs([
'image.style.event_teaser'
]);
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@ effects:
width: 762
height: 451
crop_type: focal_point
7a0d8f05-1d40-4d6e-892e-bef93b976135:
uuid: 7a0d8f05-1d40-4d6e-892e-bef93b976135
id: image_convert
weight: 2
data:
extension: webp
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ effects:
width: 362
height: 362
anchor: center-center
6c434290-d50d-438c-89ff-c6fbe291e1c0:
uuid: 6c434290-d50d-438c-89ff-c6fbe291e1c0
id: image_convert
weight: 2
data:
extension: webp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Open Y Node News
package: Open Y
description: Provides a News post content type and related configuration.
type: module
core_version_requirement: ^8 || ^9
core_version_requirement: ^8 || ^9.2
version: 8.x-1.0
dependencies:
- drupal:field
Expand Down
13 changes: 13 additions & 0 deletions openy_node/modules/openy_node_news/openy_node_news.install
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,16 @@ function openy_node_news_update_8005() {
}
}
}

/**
* Apply Webp to all image styles.
*/
function openy_node_news_update_8007() {
$path = \Drupal::service('extension.list.module')->getPath('openy_node_news') . '/config/install';
$config_importer = \Drupal::service('config_import.importer');
$config_importer->setDirectory($path);
$config_importer->importConfigs([
'image.style.node_news',
'image.style.node_news_teaser'
]);
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@ effects:
width: 500
height: 260
crop_type: focal_point
a3c828eb-41e6-4422-928a-dd1aedb80584:
uuid: a3c828eb-41e6-4422-928a-dd1aedb80584
id: image_convert
weight: 2
data:
extension: webp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Open Y Node Program
description: Provides a Program content type and related configuration.
type: module
core_version_requirement: ^8 || ^9
core_version_requirement: ^8 || ^9.2
package: Open Y
version: 8.x-1.0
dependencies:
Expand Down
12 changes: 12 additions & 0 deletions openy_node/modules/openy_node_program/openy_node_program.install
Original file line number Diff line number Diff line change
Expand Up @@ -312,3 +312,15 @@ function openy_node_program_update_8013() {
'field.field.node.program.field_header_content',
]);
}

/**
* Apply Webp to all image styles.
*/
function openy_node_program_update_8015() {
$path = \Drupal::service('extension.list.module')->getPath('openy_node_program') . '/config/install';
$config_importer = \Drupal::service('config_import.importer');
$config_importer->setDirectory($path);
$config_importer->importConfigs([
'image.style.node_program_header'
]);
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,10 @@ status: true
dependencies: { }
name: social_post_preview
label: 'Social post preview'
effects: { }
effects:
33f73c57-01b3-4354-a52d-1c7fc9aaa748:
uuid: 33f73c57-01b3-4354-a52d-1c7fc9aaa748
id: image_convert
weight: 1
data:
extension: webp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Open Y Node Social Post
description: Provides a Social post content type and related configuration.
type: module
core_version_requirement: ^8 || ^9
core_version_requirement: ^8 || ^9.2
version: 8.x-1.0
package: Open Y
dependencies:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,15 @@ function openy_node_social_post_update_8002() {
}
}
}

/**
* Apply Webp to all image styles.
*/
function openy_node_social_post_update_8004() {
$path = \Drupal::service('extension.list.module')->getPath('openy_node_social_post') . '/config/install';
$config_importer = \Drupal::service('config_import.importer');
$config_importer->setDirectory($path);
$config_importer->importConfigs([
'image.style.social_post_preview'
]);
}
2 changes: 1 addition & 1 deletion openy_node/openy_node.info.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Open Y Node Package
description: Bundle of custom content type modules for Open Y, and their common configuration.
type: module
core_version_requirement: ^8 || ^9
core_version_requirement: ^8 || ^9.2
package: Open Y
version: 8.x-1.0
configure: system.site_information_settings
Expand Down
12 changes: 12 additions & 0 deletions openy_node/openy_node.install
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,15 @@ function openy_node_update_8007() {
$view->save();
}
}

/**
* Apply Webp to all image styles.
*/
function openy_node_update_8009() {
$path = \Drupal::service('extension.list.module')->getPath('openy_node') . '/config/install';
$config_importer = \Drupal::service('config_import.importer');
$config_importer->setDirectory($path);
$config_importer->importConfigs([
'image.style.facebook'
]);
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@ effects:
width: '1920'
height: '700'
crop_type: focal_point
c7411970-f7a8-4836-9953-d7142ae43808:
uuid: c7411970-f7a8-4836-9953-d7142ae43808
id: image_convert
weight: 3
data:
extension: webp
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@ effects:
weight: -10
data:
crop_type: crop_960_600
e4410f29-3b93-4211-9926-85fd1d95e786:
uuid: e4410f29-3b93-4211-9926-85fd1d95e786
id: image_convert
weight: 3
data:
extension: webp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 'Open Y Paragraph Banner'
description: 'Implements a paragraph with banner content.'
type: module
core_version_requirement: ^8 || ^9
core_version_requirement: ^8 || ^9.2
package: 'Open Y'
version: 8.x-1.0
dependencies:
Expand Down
Loading

0 comments on commit 5aef451

Please sign in to comment.