commit
6b673a42ca
|
@ -15,7 +15,7 @@ addons:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- os: linux
|
- os: linux
|
||||||
rust: 1.26.2
|
rust: 1.31.1
|
||||||
- os: linux
|
- os: linux
|
||||||
rust: stable
|
rust: stable
|
||||||
- os: osx
|
- os: osx
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
name = "qrcode"
|
name = "qrcode"
|
||||||
description = "QR code encoder in Rust"
|
description = "QR code encoder in Rust"
|
||||||
license = "MIT / Apache-2.0"
|
license = "MIT / Apache-2.0"
|
||||||
version = "0.10.1"
|
version = "0.11.0"
|
||||||
authors = ["kennytm <kennytm@gmail.com>"]
|
authors = ["kennytm <kennytm@gmail.com>"]
|
||||||
keywords = ["qrcode"]
|
keywords = ["qrcode"]
|
||||||
repository = "https://github.com/kennytm/qrcode-rust"
|
repository = "https://github.com/kennytm/qrcode-rust"
|
||||||
|
@ -20,11 +20,11 @@ is-it-maintained-open-issues = { repository = "kennytm/qrcode-rust" }
|
||||||
maintenance = { status = "passively-maintained" }
|
maintenance = { status = "passively-maintained" }
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
image = { version = "0.21", default-features = false, optional = true }
|
image = { version = "0.22", default-features = false, optional = true }
|
||||||
checked_int_cast = "1"
|
checked_int_cast = "1"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
image = "0.21"
|
image = "0.22"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["image", "svg"]
|
default = ["image", "svg"]
|
||||||
|
|
|
@ -232,8 +232,8 @@ impl QrCode {
|
||||||
///
|
///
|
||||||
/// let image = QrCode::new(b"hello").unwrap()
|
/// let image = QrCode::new(b"hello").unwrap()
|
||||||
/// .render()
|
/// .render()
|
||||||
/// .dark_color(Rgb { data: [0, 0, 128] })
|
/// .dark_color(Rgb([0, 0, 128]))
|
||||||
/// .light_color(Rgb { data: [224, 224, 224] }) // adjust colors
|
/// .light_color(Rgb([224, 224, 224])) // adjust colors
|
||||||
/// .quiet_zone(false) // disable quiet zone (white border)
|
/// .quiet_zone(false) // disable quiet zone (white border)
|
||||||
/// .min_dimensions(300, 300) // sets minimum image size
|
/// .min_dimensions(300, 300) // sets minimum image size
|
||||||
/// .build();
|
/// .build();
|
||||||
|
@ -336,8 +336,8 @@ mod image_tests {
|
||||||
let image = code
|
let image = code
|
||||||
.render()
|
.render()
|
||||||
.min_dimensions(200, 200)
|
.min_dimensions(200, 200)
|
||||||
.dark_color(Rgb { data: [128, 0, 0] })
|
.dark_color(Rgb([128, 0, 0]))
|
||||||
.light_color(Rgb { data: [255, 255, 128] })
|
.light_color(Rgb([255, 255, 128]))
|
||||||
.build();
|
.build();
|
||||||
let expected = load_from_memory(include_bytes!("test_annex_i_micro_qr_as_image.png")).unwrap().to_rgb();
|
let expected = load_from_memory(include_bytes!("test_annex_i_micro_qr_as_image.png")).unwrap().to_rgb();
|
||||||
assert_eq!(image.dimensions(), expected.dimensions());
|
assert_eq!(image.dimensions(), expected.dimensions());
|
||||||
|
|
|
@ -13,7 +13,7 @@ macro_rules! impl_pixel_for_image_pixel {
|
||||||
|
|
||||||
fn default_color(color: Color) -> Self {
|
fn default_color(color: Color) -> Self {
|
||||||
match color.select($s::zero(), $s::max_value()) {
|
match color.select($s::zero(), $s::max_value()) {
|
||||||
$c => $p { data: $d },
|
$c => $p($d),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue