mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-25 20:02:34 +00:00
v0.4.3
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "rxing"
|
name = "rxing"
|
||||||
version = "0.4.2"
|
version = "0.4.3"
|
||||||
description="A rust port of the zxing barcode library."
|
description="A rust port of the zxing barcode library."
|
||||||
license="Apache-2.0"
|
license="Apache-2.0"
|
||||||
repository="https://github.com/rxing-core/rxing"
|
repository="https://github.com/rxing-core/rxing"
|
||||||
|
|||||||
@@ -265,6 +265,11 @@ impl BitMatrix {
|
|||||||
(self.get_offset(y, x)) >= self.bits.len()
|
(self.get_offset(y, x)) >= self.bits.len()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Confusingly returns true if the requested element is out of bounds
|
||||||
|
pub fn check_point_in_bounds(&self, point: Point) -> bool {
|
||||||
|
self.check_in_bounds(point.x as u32, point.y as u32)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>Sets the given bit to true.</p>
|
* <p>Sets the given bit to true.</p>
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -281,9 +281,7 @@ impl Circle<'_> {
|
|||||||
// count left
|
// count left
|
||||||
while {
|
while {
|
||||||
let point = get_point(self.center, (x, y), rotation);
|
let point = get_point(self.center, (x, y), rotation);
|
||||||
!self.image.check_in_bounds(point.x as u32, point.y as u32)
|
!self.image.check_point_in_bounds(point) && !self.image.get_point(point) && x > 0
|
||||||
&& !self.image.get(point.x as u32, point.y as u32)
|
|
||||||
&& x > 0
|
|
||||||
} {
|
} {
|
||||||
x -= 1;
|
x -= 1;
|
||||||
length += 1;
|
length += 1;
|
||||||
@@ -295,8 +293,7 @@ impl Circle<'_> {
|
|||||||
// count right
|
// count right
|
||||||
while {
|
while {
|
||||||
let point = get_point(self.center, (x, y), rotation);
|
let point = get_point(self.center, (x, y), rotation);
|
||||||
!self.image.check_in_bounds(point.x as u32, point.y as u32)
|
!self.image.check_point_in_bounds(point) && !self.image.get_point(point)
|
||||||
&& !self.image.get(point.x as u32, point.y as u32)
|
|
||||||
} {
|
} {
|
||||||
x += 1;
|
x += 1;
|
||||||
length += 1;
|
length += 1;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ use rxing::DecodingHintDictionary;
|
|||||||
#[test]
|
#[test]
|
||||||
fn issue_27_part_2() {
|
fn issue_27_part_2() {
|
||||||
let mut data = Vec::new();
|
let mut data = Vec::new();
|
||||||
std::fs::File::open("test_resources/blackbox/github_issue_cases/226611447-be6041dc-5b21-42fe-827b-068ccc59082c.png")
|
std::fs::File::open("test_resources/blackbox/github_issue_cases/panic_data2_issue_27.bin")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.read_to_end(&mut data)
|
.read_to_end(&mut data)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|||||||
Reference in New Issue
Block a user