From 7c23325a0cc6f64073073e9165a746852235fea4 Mon Sep 17 00:00:00 2001 From: les Date: Wed, 21 Jul 2021 11:23:32 +0200 Subject: [PATCH] minor on focalPoint precision --- server/api/controller/event.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/api/controller/event.js b/server/api/controller/event.js index f833cb3b..828aa526 100644 --- a/server/api/controller/event.js +++ b/server/api/controller/event.js @@ -297,12 +297,12 @@ const eventController = { url = await helpers.getImageFromURL(body.image_url) } - const focalpoint = body.image_focalpoint ? body.image_focalpoint.split(',') : ['0', '0'] - + let focalpoint = body.image_focalpoint ? body.image_focalpoint.split(',') : ['0', '0'] + focalpoint = [parseFloat(focalpoint[0]).toFixed(2), parseFloat(focalpoint[1]).toFixed(2)] eventDetails.media = [{ url, name: body.image_name || '', - focalpoint: [parseFloat(focalpoint[0].slice(0, 6)), parseFloat(focalpoint[1].slice(0, 6))] + focalpoint: [parseFloat(focalpoint[0]), parseFloat(focalpoint[1])] }] } else { eventDetails.media = []