Files app: additional settings options to modify preview size and crop in grid view

I would like to be able to change the size of images and whether they are cropped or not in files / grid view. I have been able to achieve these by

  • changing the grid size for #filestable.view-grid:not(.hidden) to $grid-size: 400px; in apps/files/css/files.scss, then issueing sudo -u apache php occ app:update --all, and then reloading the page
    and by
  • changing lib/private/Preview/Generator.php to set $crop = false; in function getPreview
    and then reloading the page.

I am new to Nextcloud development, so any advice on how to implement these features ‘properly’, e.g. as per user settings options for the files app or as right-click menu options, would be appreciated. I would be happy to have a go at writing and submitting a patch then.

Thanks, John