From f5454701c05c6d534cccbe37c53f3510a0a5da02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= <1005065+DeepDiver1975@users.noreply.github.com> Date: Mon, 10 Jun 2024 11:38:14 +0200 Subject: [PATCH] fix: change default value of `preview_max_dimensions` to 6016x6016 --- changelog/unreleased/41263 | 5 +++++ config/config.sample.php | 6 +++--- lib/private/Preview/Image.php | 8 ++++---- 3 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 changelog/unreleased/41263 diff --git a/changelog/unreleased/41263 b/changelog/unreleased/41263 new file mode 100644 index 000000000000..b61f80952599 --- /dev/null +++ b/changelog/unreleased/41263 @@ -0,0 +1,5 @@ +Bugfix: default value of preview_max_dimensions is now 6016x6016 + +This allows processing of 4K portrait images by default. + +https://github.com/owncloud/core/pull/41263 \ No newline at end of file diff --git a/config/config.sample.php b/config/config.sample.php index b06a8f472c82..6551e50c351e 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -1022,15 +1022,15 @@ /** * Define the maximum dimensions of the original image for preview generation - * In contrast to `preview_max_x` and `preview_max_x` which define the maximum + * In contrast to `preview_max_x` and `preview_max_y` which define the maximum * dimensions of generated previews, this setting limits the original image's size. * * Original images bigger than the defined dimension will not be processed. * * Value represents the maximum dimension in the format width x height - * Default is 6016x4000. + * Default is 6016x6016. */ -'preview_max_dimensions' => '6016x4000', +'preview_max_dimensions' => '6016x6016', /** * Define the custom path for the LibreOffice / OpenOffice binary diff --git a/lib/private/Preview/Image.php b/lib/private/Preview/Image.php index ab2c3dd217b8..984af32b3a6f 100644 --- a/lib/private/Preview/Image.php +++ b/lib/private/Preview/Image.php @@ -75,17 +75,17 @@ private function validateImageDimensions(\OC_Image $image): bool { } private function getMaxDimensions(): array { - // 24 MP - 6016 x 4000 - $maxDimension = \OC::$server->getConfig()->getSystemValue('preview_max_dimensions', '6016x4000'); + // 24 MP - 6016 x 6016 + $maxDimension = \OC::$server->getConfig()->getSystemValue('preview_max_dimensions', '6016x6016'); $exploded = explode('x', strtolower($maxDimension)); if ($exploded === false || \count($exploded) !== 2) { - return [6016, 4000]; + return [6016, 6016]; } [$w, $h] = $exploded; if (is_numeric($w) && is_numeric($h)) { return [(int)$w, (int)$h]; } - return [6016, 4000]; + return [6016, 6016]; } }