Hi and thank you for this nice image hosting script. Currently I am trying the free version (1.0.0).
I understand that most people need either fixed width or fixed height on their preview pics, so they look good in blogs etc.
I want to use the image hosting to post my pics on different forums, however. Most of the time, it's a single picture. It is a bit awkward that one orientation is much bigger than the other (e.g. medium is set to "width", 1024px. When I upload a landscape image from my phone's camera, it's scaled to 1024x768. However, uploading a portrait image gives me a 1362x1024 file.
Adding a "long side" option would give me 1024x768 / 768x1024 pics, which is what I want.
Implementing it is not very difficult:
class.settings.php:82
class.image.php:764
Of course it needs to be added in the dashboard as well, so the user can choose the option:
dashboard.php:781
Now, this is only a hasty fix and you might want to do it differently (using constants etc.).
But I think the feature would be appreciated by many users, not just me.
All the best,
Jonas
I understand that most people need either fixed width or fixed height on their preview pics, so they look good in blogs etc.
I want to use the image hosting to post my pics on different forums, however. Most of the time, it's a single picture. It is a bit awkward that one orientation is much bigger than the other (e.g. medium is set to "width", 1024px. When I upload a landscape image from my phone's camera, it's scaled to 1024x768. However, uploading a portrait image gives me a 1362x1024 file.
Adding a "long side" option would give me 1024x768 / 768x1024 pics, which is what I want.
Implementing it is not very difficult:
class.settings.php:82
PHP:
if(!in_array($settings['upload_medium_fixed_dimension'], ['width', 'height', 'longside'])) {
class.image.php:764
PHP:
// Try to generate the medium
$medium_size = getSetting('upload_medium_size');
$medium_fixed_dimension = getSetting('upload_medium_fixed_dimension');
if($medium_fixed_dimension == 'longside'){
$fileInfo = $image_upload['uploaded']['fileinfo'];
$width = $fileInfo['width'];
$height = $fileInfo['height'];
if($width>=$height){
$medium_fixed_dimension = 'width';
} else{
$medium_fixed_dimension = 'height';
}
}
Of course it needs to be added in the dashboard as well, so the user can choose the option:
dashboard.php:781
PHP:
echo CHV\Render\get_select_options_html(['width' => _s('Width'), 'height' => _s('Height'), 'longside' => _s('Long Side')], CHV\Settings::get('upload_medium_fixed_dimension'));
Now, this is only a hasty fix and you might want to do it differently (using constants etc.).
But I think the feature would be appreciated by many users, not just me.
All the best,
Jonas