<?php
$CONFIG = array (
'memcache.local' => '\\OC\\Memcache\\APCu',
'memcache.distributed' => '\\OC\\Memcache\\Redis',
'memcache.locking' => '\\OC\\Memcache\\Redis',
'redis' =>
array (
'host' => 'redis',
'port' => 6379,
'timeout' => 1.5,
),
'filelocking.enabled' => true,
'datadirectory' => '/data',
'instanceid' => '<omitted for security>',
'passwordsalt' => '<omitted for security>',
'secret' => '<omitted for security>',
'trusted_domains' =>
array (
0 => '<omitted> for security>',
),
'dbtype' => 'mysql',
'version' => '24.0.6.1',
'trusted_proxies' => ['swag'],
'overwrite.cli.url' => '<omitted for security>',
'dbname' => 'nextcloud',
'dbhost' => '10.27.0.40:3306',
'dbport' => '',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
'dbuser' => '<omitted for security>',
'dbpassword' => '<omitted for security>',
'installed' => true,
'app_install_overwrite' =>
array (
0 => 'files_excludedirs',
),
'default_phone_region' => 'GB',
'maintenance' => false,
'mail_smtpmode' => 'smtp',
'mail_smtpsecure' => 'ssl',
'mail_sendmailmode' => 'smtp',
'mail_smtpauth' => 1,
'mail_from_address' => 'No.Reply',
'mail_domain' => '<omitted for security>',
'mail_smtpauthtype' => 'LOGIN',
'mail_smtphost' => '<omitted for security>',
'mail_smtpport' => '465',
'mail_smtpname' => '<omitted for security>',
'mail_smtppassword' => '<omitted for security>',
'preview_max_x' => null,
'preview_max_y' => null,
'jpeg_quality' => '60',
'preview_max_scale_factor' => 1,
'enabledPreviewProviders' => [
'OC\Preview\MP3',
'OC\Preview\TXT',
'OC\Preview\MarkDown',
'OC\Preview\OpenDocument',
'OC\Preview\Krita',
'OC\Preview\Imaginary',
],
'preview_imaginary_url' => 'http://imaginary:9000',
);
$ php /config/www/nextcloud/occ config:app:get previewgenerator squareSizes
64 256 1024
$ php /config/www/nextcloud/occ config:app:get previewgenerator widthSizes
64 256 1024
$ php /config/www/nextcloud/occ config:app:get previewgenerator heightSizes
64 256 1024
The preview generated for both grid view and detailed view on the Files pane.

The preview generated for both grid view and detailed view on the Files pane.

Some square preview images generated with command
$ occ preview:generate-all -vvvare a crop of the original images and the aspect ratio are not preserved.
On the other hand, the square preview images generated by web interface of Nextcloud are correctly. They respect the aspect ratios and letterboxed correctly.
Environment:
The content of the config.php:
The previewgenerator settings:
A sample of an original image:

The preview generated for both grid view and detailed view on the Files pane.

Another example of an original image:

The preview generated for both grid view and detailed view on the Files pane.
