fixes #2377 add 3XL and 4XL derivatives

This commit is contained in:
HWFord
2025-06-26 12:35:03 +02:00
parent 8f3adbda79
commit b825f45537
6 changed files with 44 additions and 3 deletions

View File

@@ -0,0 +1,33 @@
<?php
// +-----------------------------------------------------------------------+
// | This file is part of Piwigo. |
// | |
// | For copyright and license information, please view the COPYING.txt |
// | file that was distributed with this source code. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
global $conf;
load_conf_from_db();
$upgrade_description = 'Add 3XL and 4XL sizes';
//Get predefined image sizes
$derivatives = unserialize($conf['derivatives']);
//get default sizes from derivative_std_params
$default_sizes = ImageStdParams::get_default_sizes();
//Get 3XL and 4XL from default values
$derivatives['d'][IMG_3XLARGE] = $default_sizes['3xlarge'];
$derivatives['d'][IMG_4XLARGE] = $default_sizes['4xlarge'];
// Save derivative new settings
ImageStdParams::set_and_save($derivatives['d']);
echo "\n".$upgrade_description."\n";
?>