From 900a0b00f9c08f98fbd27c0a9c03631af628d17c Mon Sep 17 00:00:00 2001 From: juanmitriatti Date: Wed, 29 Mar 2023 14:21:14 -0300 Subject: [PATCH 1/3] WS2-1575: Card Arrangement: PNG images not being compressed --- ..._mdm.file_metadata_plugin.getimagesize.yml | 7 +++ config/install/file_mdm.settings.yml | 4 ++ ...e_metadata_plugin.imagemagick_identify.yml | 7 +++ config/install/imagemagick.settings.yml | 59 +++++++++++++++++++ config/install/sophron.settings.yml | 3 + config/install/system.image.yml | 1 + webspark.info.yml | 3 + webspark.install | 13 +++- 8 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 config/install/file_mdm.file_metadata_plugin.getimagesize.yml create mode 100644 config/install/file_mdm.settings.yml create mode 100644 config/install/imagemagick.file_metadata_plugin.imagemagick_identify.yml create mode 100644 config/install/imagemagick.settings.yml create mode 100644 config/install/sophron.settings.yml create mode 100644 config/install/system.image.yml diff --git a/config/install/file_mdm.file_metadata_plugin.getimagesize.yml b/config/install/file_mdm.file_metadata_plugin.getimagesize.yml new file mode 100644 index 0000000..d6ebd8b --- /dev/null +++ b/config/install/file_mdm.file_metadata_plugin.getimagesize.yml @@ -0,0 +1,7 @@ +configuration: + cache: + override: false + settings: + enabled: true + expiration: 172800 + disallowed_paths: { } diff --git a/config/install/file_mdm.settings.yml b/config/install/file_mdm.settings.yml new file mode 100644 index 0000000..1cbf6d8 --- /dev/null +++ b/config/install/file_mdm.settings.yml @@ -0,0 +1,4 @@ +metadata_cache: + enabled: true + expiration: 172800 + disallowed_paths: { } diff --git a/config/install/imagemagick.file_metadata_plugin.imagemagick_identify.yml b/config/install/imagemagick.file_metadata_plugin.imagemagick_identify.yml new file mode 100644 index 0000000..d6ebd8b --- /dev/null +++ b/config/install/imagemagick.file_metadata_plugin.imagemagick_identify.yml @@ -0,0 +1,7 @@ +configuration: + cache: + override: false + settings: + enabled: true + expiration: 172800 + disallowed_paths: { } diff --git a/config/install/imagemagick.settings.yml b/config/install/imagemagick.settings.yml new file mode 100644 index 0000000..53d4cc3 --- /dev/null +++ b/config/install/imagemagick.settings.yml @@ -0,0 +1,59 @@ +quality: 75 +binaries: imagemagick +path_to_binaries: '' +prepend: '' +log_warnings: true +debug: false +locale: en_US.UTF-8 +image_formats: + PNG: + mime_type: image/png + JPEG: + mime_type: image/jpeg + JPG: + mime_type: image/jpeg + weight: 10 + enabled: false + GIF: + mime_type: image/gif + GIF87: + mime_type: image/gif + weight: 10 + enabled: false + SVG: + mime_type: image/svg+xml + enabled: false + WEBP: + mime_type: image/webp + AVIF: + mime_type: image/avif + enabled: false + TIFF: + mime_type: image/tiff + enabled: false + PDF: + mime_type: application/pdf + enabled: false + HEIC: + mime_type: image/heif + enabled: false + BMP: + mime_type: image/x-ms-bmp + enabled: false + PSD: + mime_type: image/x-photoshop + enabled: false + WBMP: + mime_type: image/vnd.wap.wbmp + enabled: false + XBM: + mime_type: image/x-xbitmap + enabled: false + ICO: + mime_type: image/vnd.microsoft.icon + enabled: false +advanced: + density: 0 + colorspace: '0' + profile: '' + coalesce: false diff --git a/config/install/sophron.settings.yml b/config/install/sophron.settings.yml new file mode 100644 index 0000000..d2ca153 --- /dev/null +++ b/config/install/sophron.settings.yml @@ -0,0 +1,3 @@ +map_option: 0 +map_class: '' +map_commands: { } diff --git a/config/install/system.image.yml b/config/install/system.image.yml new file mode 100644 index 0000000..c5fe831 --- /dev/null +++ b/config/install/system.image.yml @@ -0,0 +1 @@ +toolkit: imagemagick diff --git a/webspark.info.yml b/webspark.info.yml index 48f515c..0dc043a 100644 --- a/webspark.info.yml +++ b/webspark.info.yml @@ -96,6 +96,9 @@ install: - webspark_webdir - maxlength - field_states_ui + - file_mdm + - sophron + - imagemagick themes: - bartik - seven diff --git a/webspark.install b/webspark.install index 7b7d59d..234a470 100644 --- a/webspark.install +++ b/webspark.install @@ -272,4 +272,15 @@ function webspark_update_9012(&$sandbox) { } // Lock the configuration storage. \Drupal::state()->set('configuration_locked', TRUE); -} \ No newline at end of file +} + +/** + * Install imagemagick module and dependencies. + */ +function webspark_update_9013(&$sandbox) { + $module_installer = \Drupal::service("module_installer"); + + $module_installer->install(["file_mdm"]); + $module_installer->install(["sophron"]); + $module_installer->install(["imagemagick"]); +} From 80afc14c541c78b063aa508783379349f3839f0d Mon Sep 17 00:00:00 2001 From: juanmitriatti Date: Thu, 30 Mar 2023 09:40:06 -0300 Subject: [PATCH 2/3] WS2-1575: Importing configs for ImageMagick module --- webspark.install | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/webspark.install b/webspark.install index 234a470..2e3a576 100644 --- a/webspark.install +++ b/webspark.install @@ -283,4 +283,14 @@ function webspark_update_9013(&$sandbox) { $module_installer->install(["file_mdm"]); $module_installer->install(["sophron"]); $module_installer->install(["imagemagick"]); + + // Importing configs for ImageMagick module. + \Drupal::state()->set('configuration_locked', FALSE); + \Drupal::service('webspark.config_manager')->importConfigFile('file_mdm.file_metadata_plugin.getimagesize.yml'); + \Drupal::service('webspark.config_manager')->importConfigFile('file_mdm.settings.yml'); + \Drupal::service('webspark.config_manager')->importConfigFile('imagemagick.file_metadata_plugin.imagemagick_identify.yml'); + \Drupal::service('webspark.config_manager')->importConfigFile('imagemagick.settings.yml'); + \Drupal::service('webspark.config_manager')->importConfigFile('sophron.settings.yml'); + \Drupal::service('webspark.config_manager')->importConfigFile('system.image.yml'); + \Drupal::state()->set('configuration_locked', TRUE); } From 7d7e67917d320f0acae5017da29e3071859b285a Mon Sep 17 00:00:00 2001 From: juanmitriatti Date: Fri, 28 Apr 2023 11:31:41 -0300 Subject: [PATCH 3/3] WS2-1575: Remove files extensions. --- webspark.install | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/webspark.install b/webspark.install index 4966d7b..7fd31d9 100644 --- a/webspark.install +++ b/webspark.install @@ -290,11 +290,11 @@ function webspark_update_9013(&$sandbox) { // Importing configs for ImageMagick module. \Drupal::state()->set('configuration_locked', FALSE); - \Drupal::service('webspark.config_manager')->importConfigFile('file_mdm.file_metadata_plugin.getimagesize.yml'); - \Drupal::service('webspark.config_manager')->importConfigFile('file_mdm.settings.yml'); - \Drupal::service('webspark.config_manager')->importConfigFile('imagemagick.file_metadata_plugin.imagemagick_identify.yml'); - \Drupal::service('webspark.config_manager')->importConfigFile('imagemagick.settings.yml'); - \Drupal::service('webspark.config_manager')->importConfigFile('sophron.settings.yml'); - \Drupal::service('webspark.config_manager')->importConfigFile('system.image.yml'); + \Drupal::service('webspark.config_manager')->importConfigFile('file_mdm.file_metadata_plugin.getimagesize'); + \Drupal::service('webspark.config_manager')->importConfigFile('file_mdm.settings'); + \Drupal::service('webspark.config_manager')->importConfigFile('imagemagick.file_metadata_plugin.imagemagick_identify'); + \Drupal::service('webspark.config_manager')->importConfigFile('imagemagick.settings'); + \Drupal::service('webspark.config_manager')->importConfigFile('sophron.settings'); + \Drupal::service('webspark.config_manager')->importConfigFile('system.image'); \Drupal::state()->set('configuration_locked', TRUE); }