diff --git a/templates/index.html b/templates/index.html index d735ba1..e392be7 100644 --- a/templates/index.html +++ b/templates/index.html @@ -845,10 +845,17 @@ cropCtx.lineWidth = 3; cropCtx.strokeRect(x, y, width, height); - // Draw dimensions text + // Calculate actual video dimensions for display + const video = document.getElementById('video-preview'); + const scaleX = videoInfo.width / video.offsetWidth; + const scaleY = videoInfo.height / video.offsetHeight; + const actualWidth = Math.abs(Math.round(width * scaleX)); + const actualHeight = Math.abs(Math.round(height * scaleY)); + + // Draw dimensions text (showing actual video pixels) cropCtx.fillStyle = '#667eea'; cropCtx.font = 'bold 14px sans-serif'; - const text = `${Math.abs(Math.round(width))} × ${Math.abs(Math.round(height))}`; + const text = `${actualWidth} × ${actualHeight}`; cropCtx.fillText(text, x + 5, y - 5); }