feat: Improve OCR process - replace Tesseract with PaddleOCR (#115) #122

Merged
egullickson merged 16 commits from issue-115-improve-ocr-paddleocr into main 2026-02-08 01:13:35 +00:00
Showing only changes of commit 0499c902a8 - Show all commits

View File

@@ -318,17 +318,15 @@ export function useImageCrop(options: UseImageCropOptions = {}): UseImageCropRet
if (isDrawingRef.current) { if (isDrawingRef.current) {
isDrawingRef.current = false; isDrawingRef.current = false;
const area = cropAreaRef.current; const area = cropAreaRef.current;
// When aspect ratio constrains one dimension, only check the free dimension // Accept crop if at least one dimension is meaningful (allows thin strips like VINs)
const meetsMinSize = aspectRatio const meetsMinSize = area.width >= minSize || area.height >= minSize;
? area.width >= minSize
: area.width >= minSize && area.height >= minSize;
if (meetsMinSize) { if (meetsMinSize) {
setCropDrawn(true); setCropDrawn(true);
} }
} }
activeHandleRef.current = null; activeHandleRef.current = null;
setIsDragging(false); setIsDragging(false);
}, [minSize, aspectRatio]); }, [minSize]);
// Add global event listeners for drag // Add global event listeners for drag
useEffect(() => { useEffect(() => {