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