Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changelog/unreleased/41263
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions config/config.sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions lib/private/Preview/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it not be 36 MP? But since it is just a comment, maybe not that relevant..

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

24 mega pixel is 6k x 4k - allowing it in portrait and landscape mode results in 6k x 6k

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is okay this way ..... or is more explanation required here?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, that is fine..thx!

$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];
}
}