Change environment variable handling
All checks were successful
Build Docker image / build (push) Successful in 1m26s
Build Docker image / deploy (push) Successful in 3s
Build Docker image / verify (push) Successful in 27s

This commit is contained in:
Roman Krček
2025-07-18 10:34:09 +02:00
parent 162a158a85
commit 94e34fbc75
5 changed files with 21 additions and 27 deletions

View File

@@ -1,5 +1,6 @@
<script lang="ts">
import { onMount } from 'svelte';
import { env } from '$env/dynamic/public';
import { columnMapping, filteredSheetData, currentStep, pictures, cropRects } from '$lib/stores';
import { downloadDriveImage, isGoogleDriveUrl, createImageObjectUrl } from '$lib/google';
import PhotoCard from '../PhotoCard.svelte';
@@ -219,12 +220,12 @@
const faceWidth = (x2 - x1) * scaleX;
const faceHeight = (y2 - y1) * scaleY;
const faceCenterX = (x1 + (x2 - x1)/2) * scaleX;
const faceCenterY = (y1 + (y2 - y1)/2) * scaleY;
const faceCenterY = (y1 + (y2 - y1) / 2) * scaleY;
// Load crop config from env
const cropRatio = parseFloat(import.meta.env.VITE_CROP_RATIO || '1.0');
const offsetX = parseFloat(import.meta.env.VITE_FACE_OFFSET_X || '0.0');
const offsetY = parseFloat(import.meta.env.VITE_FACE_OFFSET_Y || '0.0');
const cropScale = parseFloat(import.meta.env.VITE_CROP_SCALE || '2.5');
const cropRatio = parseFloat(env.PUBLIC_CROP_RATIO || '1.0');
const offsetX = parseFloat(env.PUBLIC_FACE_OFFSET_X || '0.0');
const offsetY = parseFloat(env.PUBLIC_FACE_OFFSET_Y || '0.0');
const cropScale = parseFloat(env.PUBLIC_CROP_SCALE || '2.5');
// Compute crop size and center
let cropWidth = faceWidth * cropScale;
let cropHeight = cropWidth / cropRatio;