From c14638877c0bb0533a72842ccc7c73d88f5122f0 Mon Sep 17 00:00:00 2001 From: Nina Pypchenko <22447785+nina-py@users.noreply.github.com> Date: Sun, 10 Jan 2021 19:14:49 +1100 Subject: Add "Crop image previews" setting to files Added a new user setting that toggles cropping on image previews in grid view. True (default value): crops each image to a square. False: keep original aspect ratio. Signed-off-by: Nina Pypchenko <22447785+nina-py@users.noreply.github.com> Closes #18439. Signed-off-by: npmbuildbot-nextcloud[bot] --- apps/files/lib/Controller/ApiController.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'apps/files/lib/Controller/ApiController.php') diff --git a/apps/files/lib/Controller/ApiController.php b/apps/files/lib/Controller/ApiController.php index a852be5dad5..2b8d62efb7c 100644 --- a/apps/files/lib/Controller/ApiController.php +++ b/apps/files/lib/Controller/ApiController.php @@ -280,6 +280,20 @@ class ApiController extends Controller { return new Response(); } + /** + * Toggle default for cropping preview images + * + * @NoAdminRequired + * + * @param bool $crop + * @return Response + * @throws \OCP\PreConditionNotMetException + */ + public function cropImagePreviews($crop) { + $this->config->setUserValue($this->userSession->getUser()->getUID(), 'files', 'crop_image_previews', (int)$crop); + return new Response(); + } + /** * Toggle default for files grid view * -- cgit v1.2.3