rn-opencv-doc-perspective-correction 1.0.11 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -261,9 +261,8 @@ class DocumentScanner {
261
261
  return colorScore > colorThreshold ? 'G' : 'S';
262
262
  }
263
263
  catch (e) {
264
- console.warn('[OpenCV] analyzeColorComplexity lỗi, fallback S:', e === null || e === void 0 ? void 0 : e.message);
265
- // Ảnh ít màu thường dễ gây lỗi khi phân tích hơn nên ta Fallback về S
266
- return 'S';
264
+ console.error('[OpenCV] analyzeColorComplexity lỗi:', e === null || e === void 0 ? void 0 : e.message);
265
+ throw new Error(`[OpenCV analyzeColorComplexity Error]: ${e === null || e === void 0 ? void 0 : e.message}`);
267
266
  }
268
267
  finally {
269
268
  react_native_fast_opencv_1.OpenCV.clearBuffers();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rn-opencv-doc-perspective-correction",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "description": "A React Native library for document corner detection and perspective correction using react-native-fast-opencv",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/index.ts CHANGED
@@ -309,9 +309,8 @@ export class DocumentScanner {
309
309
 
310
310
  return colorScore > colorThreshold ? 'G' : 'S';
311
311
  } catch (e: any) {
312
- console.warn('[OpenCV] analyzeColorComplexity lỗi, fallback S:', e?.message);
313
- // Ảnh ít màu thường dễ gây lỗi khi phân tích hơn nên ta Fallback về S
314
- return 'S';
312
+ console.error('[OpenCV] analyzeColorComplexity lỗi:', e?.message);
313
+ throw new Error(`[OpenCV analyzeColorComplexity Error]: ${e?.message}`);
315
314
  } finally {
316
315
  OpenCV.clearBuffers();
317
316
  }