To resize the image based on height by maintaining the aspect ratio, replace
$manager->make($tmpFile)->fit(
$this->settings->get('flagrow.image-upload.resizeMaxWidth', 100),
$this->settings->get('flagrow.image-upload.resizeMaxHeight', 100)
)->save();
in vendor/flagrow/flarum-ext-image-upload/src/Commands/UploadImageHandler.php with
$manager->make($tmpFile)->resize(null, 1024, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save();
Here 1024px is the maximum height an image can have.