From 849c14cc8086622508fd87817e157cd0c5542b91 Mon Sep 17 00:00:00 2001 From: orakili Date: Mon, 19 Feb 2024 06:07:30 +0000 Subject: [PATCH] fix: add possibility to pass more options to the mutool command used to extract thumbnails Refs: RW-878 --- .../src/Plugin/Field/FieldType/ReliefWebFile.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/html/modules/custom/reliefweb_files/src/Plugin/Field/FieldType/ReliefWebFile.php b/html/modules/custom/reliefweb_files/src/Plugin/Field/FieldType/ReliefWebFile.php index d2156db69..ab987f3ea 100644 --- a/html/modules/custom/reliefweb_files/src/Plugin/Field/FieldType/ReliefWebFile.php +++ b/html/modules/custom/reliefweb_files/src/Plugin/Field/FieldType/ReliefWebFile.php @@ -877,8 +877,8 @@ protected function extractPreview($source_uri, $destination_uri, $page, $rotatio $mutool = \Drupal::state()->get('mutool', '/usr/bin/mutool'); if (is_executable($mutool)) { - // @todo add max dimensions. - $command = "{$mutool} draw -R {$rotation} -o {$destination} {$source} {$page}"; + $options = \Drupal::state()->get('mutool_options', ''); + $command = "{$mutool} draw {$options} -R {$rotation} -o {$destination} {$source} {$page}"; exec($command, $output, $return_val); // @todo log error? return empty($return_val) && @file_exists($destination_uri);