mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-27 21:02:35 +00:00
long running qrcode fix
zxing 110ef9e8f2733c051dd00e95bddc1bff6ab94ca5
This commit is contained in:
@@ -716,6 +716,15 @@ impl FinderPatternFinder {
|
|||||||
return Err(Exceptions::NotFoundException(None));
|
return Err(Exceptions::NotFoundException(None));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// for (Iterator<FinderPattern> it = possibleCenters.iterator(); it.hasNext();) {
|
||||||
|
// if (it.next().getCount() < CENTER_QUORUM) {
|
||||||
|
// it.remove();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
self.possibleCenters
|
||||||
|
.retain(|fp| fp.getCount() >= Self::CENTER_QUORUM);
|
||||||
|
|
||||||
self.possibleCenters.sort_by(|x, y| {
|
self.possibleCenters.sort_by(|x, y| {
|
||||||
x.getEstimatedModuleSize()
|
x.getEstimatedModuleSize()
|
||||||
.partial_cmp(&y.getEstimatedModuleSize())
|
.partial_cmp(&y.getEstimatedModuleSize())
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use rxing::{maxicode::MaxiCodeReader, BarcodeFormat, DecodeHintType, MultiFormatReader};
|
use rxing::{BarcodeFormat, DecodeHintType, MultiFormatReader};
|
||||||
|
|
||||||
mod common;
|
mod common;
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ fn maxicode1_test_case() {
|
|||||||
BarcodeFormat::MAXICODE,
|
BarcodeFormat::MAXICODE,
|
||||||
);
|
);
|
||||||
// super("src/test/resources/blackbox/maxicode-1", new MultiFormatReader(), BarcodeFormat.MAXICODE);
|
// super("src/test/resources/blackbox/maxicode-1", new MultiFormatReader(), BarcodeFormat.MAXICODE);
|
||||||
tester.add_test(6, 6, 0.0);
|
tester.add_test(7, 7, 0.0);
|
||||||
|
|
||||||
tester.test_black_box();
|
tester.test_black_box();
|
||||||
}
|
}
|
||||||
@@ -44,7 +44,7 @@ fn maxicode1_test_case() {
|
|||||||
fn maxi_code_black_box1_test_case() {
|
fn maxi_code_black_box1_test_case() {
|
||||||
let mut tester = common::AbstractBlackBoxTestCase::new(
|
let mut tester = common::AbstractBlackBoxTestCase::new(
|
||||||
"test_resources/blackbox/maxicode-1",
|
"test_resources/blackbox/maxicode-1",
|
||||||
MaxiCodeReader {},
|
MultiFormatReader::default(),
|
||||||
BarcodeFormat::MAXICODE,
|
BarcodeFormat::MAXICODE,
|
||||||
);
|
);
|
||||||
// super("src/test/resources/blackbox/maxicode-1", new MultiFormatReader(), BarcodeFormat.MAXICODE);
|
// super("src/test/resources/blackbox/maxicode-1", new MultiFormatReader(), BarcodeFormat.MAXICODE);
|
||||||
@@ -53,7 +53,7 @@ fn maxi_code_black_box1_test_case() {
|
|||||||
rxing::DecodeHintValue::PureBarcode(true),
|
rxing::DecodeHintValue::PureBarcode(true),
|
||||||
);
|
);
|
||||||
|
|
||||||
tester.add_test(1, 1, 0.0);
|
tester.add_test(7, 7, 0.0);
|
||||||
|
|
||||||
tester.test_black_box();
|
tester.test_black_box();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ fn qrcode_black_box2_test_case() {
|
|||||||
BarcodeFormat::QR_CODE,
|
BarcodeFormat::QR_CODE,
|
||||||
);
|
);
|
||||||
tester.add_test(31, 31, 0.0);
|
tester.add_test(31, 31, 0.0);
|
||||||
tester.add_test(30, 30, 90.0);
|
tester.add_test(29, 29, 90.0);
|
||||||
tester.add_test(30, 30, 180.0);
|
tester.add_test(30, 30, 180.0);
|
||||||
tester.add_test(30, 30, 270.0);
|
tester.add_test(30, 30, 270.0);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user