From 9411801245456fb5afb352d6836ecff2aded5f9b Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Mon, 12 Sep 2022 12:15:49 +0200 Subject: [PATCH 1/3] feat(qrcode): Remove decoding QR code from an image. This patch removes the `decode_image` (default) feature for this `matrix-sdk-qrcode` crate. First reason is that `rqrr` panics for some particular QR codes, and we don't want to panic. Second reason is that it's not a feature that is used. For Element on iOS and Android, it's very unlikely that every frame from the camera will be sent to `matrix-sdk-qrcode` to see if it can be decoded. So it's obvious that an external library is used to read the bytes from the QR code, that are then sent to `matrix-sdk-qrcode`. For Element on Web, it's basically the same argument. This feature is actually used only in our tests to ensure the generated QR code is valid, but it sometimes fails due to `rqrr` (cf. First reason). --- crates/matrix-sdk-qrcode/Cargo.toml | 8 -- crates/matrix-sdk-qrcode/README.md | 20 +--- .../matrix-sdk-qrcode/data/self-no-master.png | Bin 1775 -> 0 bytes .../data/self-verification.png | Bin 1467 -> 0 bytes .../matrix-sdk-qrcode/data/verification.png | Bin 4277 -> 0 bytes crates/matrix-sdk-qrcode/src/error.rs | 4 - crates/matrix-sdk-qrcode/src/lib.rs | 111 ------------------ crates/matrix-sdk-qrcode/src/types.rs | 87 -------------- crates/matrix-sdk-qrcode/src/utils.rs | 30 ----- 9 files changed, 3 insertions(+), 257 deletions(-) delete mode 100644 crates/matrix-sdk-qrcode/data/self-no-master.png delete mode 100644 crates/matrix-sdk-qrcode/data/self-verification.png delete mode 100644 crates/matrix-sdk-qrcode/data/verification.png diff --git a/crates/matrix-sdk-qrcode/Cargo.toml b/crates/matrix-sdk-qrcode/Cargo.toml index de6f69d29..79b9a1657 100644 --- a/crates/matrix-sdk-qrcode/Cargo.toml +++ b/crates/matrix-sdk-qrcode/Cargo.toml @@ -15,18 +15,10 @@ repository = "https://github.com/matrix-org/matrix-rust-sdk" all-features = true rustdoc-args = ["--cfg", "docsrs"] -[features] -default = ["decode_image"] -decode_image = ["dep:image", "dep:rqrr", "qrcode/image", "qrcode/svg"] - [dependencies] base64 = "0.13.0" byteorder = "1.4.3" -# image and rqrr can't be upgraded before qrcode gets updated -# https://github.com/matrix-org/matrix-rust-sdk/issues/690 -image = { version = "0.23.0", optional = true } qrcode = { version = "0.12.0", default-features = false } -rqrr = { version = "0.4.0", optional = true } ruma-common = { git = "https://github.com/ruma/ruma", rev = "c745d3baf720b38a254e640a526717864e87a065" } thiserror = "1.0.30" diff --git a/crates/matrix-sdk-qrcode/README.md b/crates/matrix-sdk-qrcode/README.md index bbf9426ca..05c3e5a9c 100644 --- a/crates/matrix-sdk-qrcode/README.md +++ b/crates/matrix-sdk-qrcode/README.md @@ -6,27 +6,13 @@ interactive verification using [QR codes] in Matrix. This is probably not the crate you are looking for, it's used internally in the [matrix-sdk]. -If you still want to play with QR codes, here are a couple of helpful examples. - -### Decode an image - -```rust,no_run -use image; -use matrix_sdk_qrcode::{QrVerificationData, DecodingError}; - -fn main() -> Result<(), DecodingError> { - let image = image::open("/path/to/my/image.png").unwrap(); - let result = QrVerificationData::from_image(image)?; - - Ok(()) -} -``` +If you still want to play with QR codes, here is a helpful example. ### Encode into a QR code ```rust,no_run use matrix_sdk_qrcode::{QrVerificationData, DecodingError}; -use image::Luma; +//use image::Luma; fn main() -> Result<(), DecodingError> { let data = b"MATRIX\ @@ -38,7 +24,7 @@ fn main() -> Result<(), DecodingError> { let data = QrVerificationData::from_bytes(data)?; let encoded = data.to_qr_code().unwrap(); - let image = encoded.render::>().build(); + //let image = encoded.render::>().build(); Ok(()) } diff --git a/crates/matrix-sdk-qrcode/data/self-no-master.png b/crates/matrix-sdk-qrcode/data/self-no-master.png deleted file mode 100644 index 1bffd19eef81114da9e9cce4af8cfb7fae37a4e9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1775 zcma)-dpOg39LGJaq{LFE<5H@VT$W1?c~()wgXjFMD}rOogO-2HD@v{Wm=pij;;6aj*8dO}KgnXV zJ#*ML3yrSb`p0gre4l4F9;?m%=-ch@z>gbSI^G#$hbFvJU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q)@qV` z54cT~w1wNAfc0QoP~2$p$xM>vsrX6&7aX+laKsNG*5dT!z=Zi0DD}}TqG}>6aGBNf zTa9H7dm&q}a+!`l&~XRQ`zK(=7l=b~XyJNSUAp6PL8{SMXzE@X_o)BSGV7oMF$H*% z%OZR3k(NUnDO&q#D;Fshyaeb+1~$Kw&ti%n+)@+7t@(%`czF80g}Fcxo7WX9X~^nF zOg}3Fs=`Si!>6rWb<)a6RW~+fdEcb&%0jF`$I@S(jr@v$DRAcR}33)=*UePS$9HQr~@9)}lEVUnV; z50~1XX7a=4*0`aci=eu-_qKJ31vJPhC|kBTt^w!1Qd_}yG7Aej_vnutEu>a3jZGjv zlan1+dT$72G!2Y1@Lm`#XLQ$P|=F*hRxejTxx1lmg!COrUM`0hs z`|%aT+$MV2$(x2O$Bp2~X5G zOnUUPds{`lPZZ@#uy24EL6I9zJB``4UTsWbPYETO&0Pi|t)O|hGGf>Z{C?rE0Nem;lItt4o&4-Lxl^cyhxV^4A; zBhH%xwn;fmzbR6MJ$>v9XFc(N8Sfj;%u~%#i*J!f#x!q)$E!iP@g6O;YT1X0pJ;Vx<&-MMZ} zJ*AV5Es~^IzR=z5w;KF(lB}x}l28D6h?Os+VdY{`5?jBIgxdXfvpjNH+qd>XoA-+W zMtkjQZ8|7(`**G6xs?2=F+!SG$%5ipK}Z|4D1wwhmQf4{?h$B+AF)J!Omrh z$ziBYy`6sQ(n1H&qk1+J6sq7E{PC#n>GErYhz6^9{?AghoA_v~26HDaYkeEr5I!MB Jiw++9`fuI4&2j($ diff --git a/crates/matrix-sdk-qrcode/data/verification.png b/crates/matrix-sdk-qrcode/data/verification.png deleted file mode 100644 index e4a918ecbda618e9a085a53500f52a3edc9176d2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4277 zcmb7IjX#t7`=8lrn`py)I|?%~^AMfm^x$D^bjZ^@>@+9kDIJuo^UYHwo3)eSWJHv( z-D-{ug~YYKiB)Z-q-uOGyHtr zH4*v<5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Em7*obLKHyRNqgKk5Nlyx=>oD&MHO>$nj32;)6i4J@VI2 z=9w(IO@tD4`@6=aBK`a=c+g=)k=b8YIn&LMmJNIecHwgZ5bl=bc+x=jF=8=2@OE!H zWOW|8_uiYk!hd|$?;CuIV>JRYqj|N38DyO!g@>ydGvKyIaT|K?@?Fq9dQw5^oZM9@ zGWyqNYreJ}diRGwVsXokEaxd7O>3u6BB&d37Kl(W*4Bsj)w6N?+UM+(4*C+Zv_URn zRV7pFgB@cXpNNqU%EwrP9i|ZYTX3`q%2NG^1N-%UwjBpW z3(;R?*9W(ReGBYwFaQQQRn<((S^#MnGC9tjze|Dw8ISM-E-WYN1LE@;TF zcDuUp#?>)1>;gw+35(+t0|%LjCUWvP#aW`G$?G&Jq+G z*He;rI`&W}){hv})4KT_MnQ7+(DLpBR>().build(); - let second_result = QrVerificationData::try_from(image).unwrap(); - - assert_eq!(result, second_result); - - let bytes = result.to_bytes().unwrap(); - let third_result = QrVerificationData::from_bytes(bytes).unwrap(); - - assert_eq!(result, third_result); - } - - #[test] - #[cfg(feature = "decode_image")] - fn decode_encode_cycle_self() { - let image = Cursor::new(SELF_VERIFICATION); - let image = image::load(image, ImageFormat::Png).unwrap(); - let result = QrVerificationData::try_from(image).unwrap(); - - assert!(matches!(result, QrVerificationData::SelfVerification(_))); - - let encoded = result.to_qr_code().unwrap(); - let image = encoded.render::>().build(); - let second_result = QrVerificationData::from_luma(image).unwrap(); - - assert_eq!(result, second_result); - - let bytes = result.to_bytes().unwrap(); - let third_result = QrVerificationData::from_bytes(bytes).unwrap(); - - assert_eq!(result, third_result); - } - - #[test] - #[cfg(feature = "decode_image")] - fn decode_encode_cycle_self_no_master() { - let image = Cursor::new(SELF_NO_MASTER); - let image = image::load(image, ImageFormat::Png).unwrap(); - let result = QrVerificationData::from_image(image).unwrap(); - - assert!(matches!(result, QrVerificationData::SelfVerificationNoMasterKey(_))); - - let encoded = result.to_qr_code().unwrap(); - let image = encoded.render::>().build(); - let second_result = QrVerificationData::try_from(image).unwrap(); - - assert_eq!(result, second_result); - - let bytes = result.to_bytes().unwrap(); - let third_result = QrVerificationData::try_from(bytes).unwrap(); - - assert_eq!(result, third_result); - } - - #[test] - #[cfg(feature = "decode_image")] - fn decode_invalid_qr() { - let qr = QrCode::new(b"NonMatrixCode").expect("Can't build a simple QR code"); - let image = qr.render::>().build(); - let result = QrVerificationData::try_from(image); - assert!(matches!(result, Err(DecodingError::Header))) - } - #[test] fn decode_invalid_header() { let data = b"NonMatrixCode"; diff --git a/crates/matrix-sdk-qrcode/src/types.rs b/crates/matrix-sdk-qrcode/src/types.rs index 26dc4ef25..829e893ec 100644 --- a/crates/matrix-sdk-qrcode/src/types.rs +++ b/crates/matrix-sdk-qrcode/src/types.rs @@ -18,14 +18,10 @@ use std::{ }; use byteorder::{BigEndian, ReadBytesExt}; -#[cfg(feature = "decode_image")] -use image::{DynamicImage, GenericImage, GenericImageView, ImageBuffer, Luma}; use qrcode::QrCode; use ruma_common::{serde::Base64, OwnedEventId}; use vodozemac::Ed25519PublicKey; -#[cfg(feature = "decode_image")] -use crate::utils::decode_qr; use crate::{ error::{DecodingError, EncodingError}, utils::{to_bytes, to_qr_code, HEADER, MAX_MODE, MIN_SECRET_LEN, VERSION}, @@ -44,25 +40,6 @@ pub enum QrVerificationData { SelfVerificationNoMasterKey(SelfVerificationNoMasterKey), } -#[cfg(feature = "decode_image")] -impl TryFrom for QrVerificationData { - type Error = DecodingError; - - fn try_from(image: DynamicImage) -> Result { - Self::from_image(image) - } -} - -// FIXME: We can't implement the generic trait because of https://github.com/rust-lang/rust/issues/50133 -#[cfg(feature = "decode_image")] -impl TryFrom, Vec>> for QrVerificationData { - type Error = DecodingError; - - fn try_from(image: ImageBuffer, Vec>) -> Result { - Self::from_luma(image) - } -} - impl TryFrom<&[u8]> for QrVerificationData { type Error = DecodingError; @@ -80,59 +57,6 @@ impl TryFrom> for QrVerificationData { } impl QrVerificationData { - /// Decode and parse an image of a QR code into a `QrVerificationData` - /// - /// The image will be converted into a grey scale image before decoding is - /// attempted - /// - /// # Arguments - /// - /// * `image` - The image containing the QR code. - /// - /// # Example - /// ```no_run - /// # use matrix_sdk_qrcode::{QrVerificationData, DecodingError}; - /// # fn main() -> Result<(), DecodingError> { - /// use image; - /// - /// let image = image::open("/path/to/my/image.png").unwrap(); - /// let result = QrVerificationData::from_image(image)?; - /// # Ok(()) - /// # } - /// ``` - #[cfg(feature = "decode_image")] - pub fn from_image(image: DynamicImage) -> Result { - let image = image.to_luma8(); - Self::decode(image) - } - - /// Decode and parse an grey scale image of a QR code into a - /// `QrVerificationData` - /// - /// # Arguments - /// - /// * `image` - The grey scale image containing the QR code. - /// - /// # Example - /// ```no_run - /// # use matrix_sdk_qrcode::{QrVerificationData, DecodingError}; - /// # fn main() -> Result<(), DecodingError> { - /// use image; - /// - /// let image = image::open("/path/to/my/image.png").unwrap(); - /// let image = image.to_luma8(); - /// let result = QrVerificationData::from_luma(image)?; - /// # Ok(()) - /// # } - /// ``` - #[cfg(feature = "decode_image")] - pub fn from_luma(image: I) -> Result - where - I: GenericImage> + GenericImageView>, - { - Self::decode(image) - } - /// Parse the decoded payload of a QR code in byte slice form as a /// `QrVerificationData` /// @@ -295,17 +219,6 @@ impl QrVerificationData { QrVerificationData::new(mode, flow_id, first_key, second_key, shared_secret) } - /// Decode the given image of an QR code and if we find a valid code, try to - /// decode it as a `QrVerification`. - #[cfg(feature = "decode_image")] - fn decode(image: I) -> Result - where - I: GenericImage> + GenericImageView>, - { - let decoded = decode_qr(image)?; - Self::decode_bytes(decoded) - } - fn new( mode: u8, flow_id: Vec, diff --git a/crates/matrix-sdk-qrcode/src/utils.rs b/crates/matrix-sdk-qrcode/src/utils.rs index 5c819b259..d39cf002a 100644 --- a/crates/matrix-sdk-qrcode/src/utils.rs +++ b/crates/matrix-sdk-qrcode/src/utils.rs @@ -12,14 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#[cfg(feature = "decode_image")] -use image::{GenericImage, GenericImageView, Luma}; use qrcode::{bits::Bits, EcLevel, QrCode, Version}; use ruma_common::serde::Base64; use vodozemac::Ed25519PublicKey; -#[cfg(feature = "decode_image")] -use crate::error::DecodingError; use crate::error::EncodingError; pub(crate) const HEADER: &[u8] = b"MATRIX"; @@ -76,29 +72,3 @@ pub(crate) fn to_qr_code( Ok(QrCode::with_bits(bits, EcLevel::L)?) } - -#[cfg(feature = "decode_image")] -pub(crate) fn decode_qr(image: I) -> Result, DecodingError> -where - I: GenericImage> + GenericImageView>, -{ - let mut image = rqrr::PreparedImage::prepare(image); - let grids = image.detect_grids(); - - let mut error = None; - - for grid in grids { - let mut decoded = Vec::new(); - - match grid.decode_to(&mut decoded) { - Ok(_) => { - if decoded.starts_with(HEADER) { - return Ok(decoded); - } - } - Err(e) => error = Some(e), - } - } - - Err(error.map(|e| e.into()).unwrap_or_else(|| DecodingError::Header)) -} From 478529f230fbee917907707ab0b713d95a3bf293 Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Mon, 12 Sep 2022 12:28:31 +0200 Subject: [PATCH 2/3] chore: Update `Cargo.lock`. --- Cargo.lock | 435 ++++++++++++++--------------------------------------- 1 file changed, 116 insertions(+), 319 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 775eb23bf..29053d97c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,12 +17,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "adler32" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" - [[package]] name = "aead" version = "0.4.3" @@ -127,8 +121,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87bf87e6e8b47264efa9bde63d6225c6276a52e05e91bf37eaa8afd0032d6b71" dependencies = [ "askama_shared", - "proc-macro2 1.0.43", - "syn 1.0.99", + "proc-macro2", + "syn", ] [[package]] @@ -147,10 +141,10 @@ dependencies = [ "mime", "mime_guess", "nom", - "proc-macro2 1.0.43", - "quote 1.0.21", + "proc-macro2", + "quote", "serde", - "syn 1.0.99", + "syn", "toml", ] @@ -212,9 +206,9 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10f203db73a71dfa2fb6dd22763990fa26f3d2625a6da2da900d23b87d26be27" dependencies = [ - "proc-macro2 1.0.43", - "quote 1.0.21", - "syn 1.0.99", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -223,9 +217,9 @@ version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76464446b8bc32758d7e88ee1a804d9914cd9b1cb264c029899680b0be29826f" dependencies = [ - "proc-macro2 1.0.43", - "quote 1.0.21", - "syn 1.0.99", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -278,7 +272,7 @@ dependencies = [ "cc", "cfg-if", "libc", - "miniz_oxide 0.5.4", + "miniz_oxide", "object", "rustc-demangle", ] @@ -573,9 +567,9 @@ checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" dependencies = [ "heck", "proc-macro-error", - "proc-macro2 1.0.43", - "quote 1.0.21", - "syn 1.0.99", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -653,9 +647,9 @@ version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef196d5d972878a48da7decb7686eded338b4858fbabeed513d63a7c98b2b82d" dependencies = [ - "proc-macro2 1.0.43", - "quote 1.0.21", - "unicode-xid 0.2.3", + "proc-macro2", + "quote", + "unicode-xid", ] [[package]] @@ -834,8 +828,8 @@ version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdffe87e1d521a10f9696f833fe502293ea446d7f256c06128293a4119bdf4cb" dependencies = [ - "quote 1.0.21", - "syn 1.0.99", + "quote", + "syn", ] [[package]] @@ -879,10 +873,10 @@ checksum = "649c91bc01e8b1eac09fb91e8dbc7d517684ca6be8ebc75bb9cafc894f9fdb6f" dependencies = [ "fnv", "ident_case", - "proc-macro2 1.0.43", - "quote 1.0.21", + "proc-macro2", + "quote", "strsim", - "syn 1.0.99", + "syn", ] [[package]] @@ -892,8 +886,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ddfc69c5bfcbd2fc09a0f38451d2daf0e372e367986a83906d1b0dbc88134fb5" dependencies = [ "darling_core", - "quote 1.0.21", - "syn 1.0.99", + "quote", + "syn", ] [[package]] @@ -903,7 +897,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "907076dfda823b0b36d2a1bb5f90c96660a5bbcd7729e10727f07858f22c4edc" dependencies = [ "cfg-if", - "hashbrown 0.12.3", + "hashbrown", "lock_api", "once_cell", "parking_lot_core 0.9.3", @@ -937,16 +931,6 @@ dependencies = [ "uuid 1.1.2", ] -[[package]] -name = "deflate" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73770f8e1fe7d64df17ca66ad28994a0a623ea497fa69486e14984e715c5d174" -dependencies = [ - "adler32", - "byteorder", -] - [[package]] name = "der" version = "0.5.1" @@ -972,9 +956,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f91d4cfa921f1c05904dc3c57b4a32c38aed3340cce209f3a6fd1478babafc4" dependencies = [ "darling", - "proc-macro2 1.0.43", - "quote 1.0.21", - "syn 1.0.99", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -984,7 +968,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f0314b72bed045f3a68671b3c86328386762c93f82d98c65c3cb5e5f573dd68" dependencies = [ "derive_builder_core", - "syn 1.0.99", + "syn", ] [[package]] @@ -1060,9 +1044,9 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3bf95dc3f046b9da4f2d51833c0d3547d8564ef6910f5c1ed130306a75b92886" dependencies = [ - "proc-macro2 1.0.43", - "quote 1.0.21", - "syn 1.0.99", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -1292,9 +1276,9 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5129068fe3183546eaa0529af88ab0afbcddec2a373db69e94a20b8d5f6c4d74" dependencies = [ - "proc-macro2 1.0.43", - "quote 1.0.21", - "syn 1.0.99", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -1356,7 +1340,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" dependencies = [ "crc32fast", - "miniz_oxide 0.5.4", + "miniz_oxide", ] [[package]] @@ -1480,9 +1464,9 @@ version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42cd15d1c7456c04dbdf7e88bcd69760d74f3a798d6444e16974b505b0e62f17" dependencies = [ - "proc-macro2 1.0.43", - "quote 1.0.21", - "syn 1.0.99", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -1543,34 +1527,6 @@ dependencies = [ "byteorder", ] -[[package]] -name = "g2gen" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fc100b16c63808c5c388cd23ff94c5a35cf28ea459f336323f7948a39480555" -dependencies = [ - "g2poly", - "proc-macro2 0.4.30", - "quote 0.6.13", - "syn 0.15.44", -] - -[[package]] -name = "g2p" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf09bc632629cbe5420b330e45bcc8f80403e74ba1027d213258914fd5c62755" -dependencies = [ - "g2gen", - "g2poly", -] - -[[package]] -name = "g2poly" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e837767888fca507f07e89c90e0b350da7bbb89170f67a4655dc9bdc4cca457b" - [[package]] name = "generic-array" version = "0.14.6" @@ -1665,15 +1621,6 @@ version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" -[[package]] -name = "hashbrown" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" -dependencies = [ - "ahash", -] - [[package]] name = "hashbrown" version = "0.12.3" @@ -1868,25 +1815,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "image" -version = "0.23.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24ffcb7e7244a9bf19d35bf2883b9c080c4ced3c07a9895572178cdb8f13f6a1" -dependencies = [ - "bytemuck", - "byteorder", - "color_quant", - "gif", - "jpeg-decoder 0.1.22", - "num-iter", - "num-rational 0.3.2", - "num-traits", - "png 0.16.8", - "scoped_threadpool", - "tiff 0.6.1", -] - [[package]] name = "image" version = "0.24.3" @@ -1897,12 +1825,12 @@ dependencies = [ "byteorder", "color_quant", "gif", - "jpeg-decoder 0.2.6", - "num-rational 0.4.1", + "jpeg-decoder", + "num-rational", "num-traits", - "png 0.17.6", + "png", "scoped_threadpool", - "tiff 0.7.3", + "tiff", ] [[package]] @@ -1931,7 +1859,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" dependencies = [ "autocfg", - "hashbrown 0.12.3", + "hashbrown", "serde", ] @@ -2020,15 +1948,6 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" -[[package]] -name = "jpeg-decoder" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "229d53d58899083193af11e15917b5640cd40b29ff475a1fe4ef725deb02d0f2" -dependencies = [ - "rayon", -] - [[package]] name = "jpeg-decoder" version = "0.2.6" @@ -2112,22 +2031,13 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "lru" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ea2d928b485416e8908cff2d97d621db22b27f7b3b6729e438bcf42c671ba91" -dependencies = [ - "hashbrown 0.11.2", -] - [[package]] name = "lru" version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e999beba7b6e8345721bd280141ed958096a2e4abdf74f67ff4ce49b4b54e47a" dependencies = [ - "hashbrown 0.12.3", + "hashbrown", ] [[package]] @@ -2174,7 +2084,7 @@ dependencies = [ "futures-util", "getrandom 0.2.7", "http", - "image 0.24.3", + "image", "matches", "matrix-sdk-base", "matrix-sdk-common", @@ -2240,7 +2150,7 @@ dependencies = [ "futures-signals", "futures-util", "http", - "lru 0.7.8", + "lru", "matrix-sdk-common", "matrix-sdk-crypto", "matrix-sdk-test", @@ -2449,9 +2359,7 @@ version = "0.3.0" dependencies = [ "base64", "byteorder", - "image 0.23.14", "qrcode", - "rqrr", "ruma-common", "thiserror", "vodozemac", @@ -2522,9 +2430,9 @@ dependencies = [ name = "matrix-sdk-test-macros" version = "0.2.0" dependencies = [ - "proc-macro2 1.0.43", - "quote 1.0.21", - "syn 1.0.99", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -2573,25 +2481,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" -[[package]] -name = "miniz_oxide" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "791daaae1ed6889560f8c4359194f56648355540573244a5448a83ba1ecc7435" -dependencies = [ - "adler32", -] - -[[package]] -name = "miniz_oxide" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" -dependencies = [ - "adler", - "autocfg", -] - [[package]] name = "miniz_oxide" version = "0.5.4" @@ -2638,9 +2527,9 @@ source = "git+https://github.com/Hywan/napi-rs?branch=fix-napi-strict-on-t-and-r dependencies = [ "convert_case", "napi-derive-backend", - "proc-macro2 1.0.43", - "quote 1.0.21", - "syn 1.0.99", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -2650,10 +2539,10 @@ source = "git+https://github.com/Hywan/napi-rs?branch=fix-napi-strict-on-t-and-r dependencies = [ "convert_case", "once_cell", - "proc-macro2 1.0.43", - "quote 1.0.21", + "proc-macro2", + "quote", "regex", - "syn 1.0.99", + "syn", ] [[package]] @@ -2738,28 +2627,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-iter" -version = "0.1.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - [[package]] name = "num-rational" version = "0.4.1" @@ -2870,9 +2737,9 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" dependencies = [ - "proc-macro2 1.0.43", - "quote 1.0.21", - "syn 1.0.99", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -3004,9 +2871,9 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ - "proc-macro2 1.0.43", - "quote 1.0.21", - "syn 1.0.99", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -3071,18 +2938,6 @@ dependencies = [ "plotters-backend", ] -[[package]] -name = "png" -version = "0.16.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c3287920cb847dee3de33d301c463fba14dda99db24214ddf93f83d3021f4c6" -dependencies = [ - "bitflags", - "crc32fast", - "deflate", - "miniz_oxide 0.3.7", -] - [[package]] name = "png" version = "0.17.6" @@ -3092,7 +2947,7 @@ dependencies = [ "bitflags", "crc32fast", "flate2", - "miniz_oxide 0.5.4", + "miniz_oxide", ] [[package]] @@ -3152,9 +3007,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", - "proc-macro2 1.0.43", - "quote 1.0.21", - "syn 1.0.99", + "proc-macro2", + "quote", + "syn", "version_check", ] @@ -3164,20 +3019,11 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "proc-macro2 1.0.43", - "quote 1.0.21", + "proc-macro2", + "quote", "version_check", ] -[[package]] -name = "proc-macro2" -version = "0.4.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" -dependencies = [ - "unicode-xid 0.1.0", -] - [[package]] name = "proc-macro2" version = "1.0.43" @@ -3222,9 +3068,9 @@ checksum = "7b670f45da57fb8542ebdbb6105a925fe571b67f9e7ed9f47a06a84e72b4e7cc" dependencies = [ "anyhow", "itertools", - "proc-macro2 1.0.43", - "quote 1.0.21", - "syn 1.0.99", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -3245,7 +3091,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16d2f1455f3630c6e5107b4f2b94e74d76dea80736de0981fd27644216cff57f" dependencies = [ "checked_int_cast", - "image 0.23.14", ] [[package]] @@ -3263,22 +3108,13 @@ dependencies = [ "memchr", ] -[[package]] -name = "quote" -version = "0.6.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" -dependencies = [ - "proc-macro2 0.4.30", -] - [[package]] name = "quote" version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" dependencies = [ - "proc-macro2 1.0.43", + "proc-macro2", ] [[package]] @@ -3523,17 +3359,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "rqrr" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fa79947f53b20adb909a323d828d0fd744fa9d854792df07913b083bcd4d63b" -dependencies = [ - "g2p", - "image 0.23.14", - "lru 0.6.6", -] - [[package]] name = "ruma" version = "0.6.3" @@ -3631,11 +3456,11 @@ source = "git+https://github.com/ruma/ruma?rev=c745d3baf720b38a254e640a526717864 dependencies = [ "once_cell", "proc-macro-crate", - "proc-macro2 1.0.43", - "quote 1.0.21", + "proc-macro2", + "quote", "ruma-identifiers-validation", "serde", - "syn 1.0.99", + "syn", "toml", ] @@ -3709,9 +3534,9 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "107c3d5d7f370ac09efa62a78375f94d94b8a33c61d8c278b96683fb4dbf2d8d" dependencies = [ - "proc-macro2 1.0.43", - "quote 1.0.21", - "syn 1.0.99", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -3781,9 +3606,9 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bdbda6ac5cd1321e724fa9cee216f3a61885889b896f073b8f82322789c5250e" dependencies = [ - "proc-macro2 1.0.43", - "quote 1.0.21", - "syn 1.0.99", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -3862,9 +3687,9 @@ version = "1.0.144" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94ed3a816fb1d101812f83e789f888322c34e291f894f19590dc310963e87a00" dependencies = [ - "proc-macro2 1.0.43", - "quote 1.0.21", - "syn 1.0.99", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -4096,25 +3921,14 @@ dependencies = [ "symbolic-common", ] -[[package]] -name = "syn" -version = "0.15.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" -dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "unicode-xid 0.1.0", -] - [[package]] name = "syn" version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13" dependencies = [ - "proc-macro2 1.0.43", - "quote 1.0.21", + "proc-macro2", + "quote", "unicode-ident", ] @@ -4124,10 +3938,10 @@ version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ - "proc-macro2 1.0.43", - "quote 1.0.21", - "syn 1.0.99", - "unicode-xid 0.2.3", + "proc-macro2", + "quote", + "syn", + "unicode-xid", ] [[package]] @@ -4204,9 +4018,9 @@ version = "1.0.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8f2591983642de85c921015f3f070c665a197ed69e417af436115e3a1407487" dependencies = [ - "proc-macro2 1.0.43", - "quote 1.0.21", - "syn 1.0.99", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -4218,17 +4032,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "tiff" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a53f4706d65497df0c4349241deddf35f84cee19c87ed86ea8ca590f4464437" -dependencies = [ - "jpeg-decoder 0.1.22", - "miniz_oxide 0.4.4", - "weezl", -] - [[package]] name = "tiff" version = "0.7.3" @@ -4236,7 +4039,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7259662e32d1e219321eb309d5f9d898b779769d81b76e762c07c8e5d38fcb65" dependencies = [ "flate2", - "jpeg-decoder 0.2.6", + "jpeg-decoder", "weezl", ] @@ -4301,9 +4104,9 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" dependencies = [ - "proc-macro2 1.0.43", - "quote 1.0.21", - "syn 1.0.99", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -4412,9 +4215,9 @@ version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11c75893af559bc8e10716548bdef5cb2b983f8e637db9d0e15126b61b484ee2" dependencies = [ - "proc-macro2 1.0.43", - "quote 1.0.21", - "syn 1.0.99", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -4511,12 +4314,6 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" -[[package]] -name = "unicode-xid" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" - [[package]] name = "unicode-xid" version = "0.2.3" @@ -4580,10 +4377,10 @@ dependencies = [ "camino", "fs-err", "once_cell", - "proc-macro2 1.0.43", - "quote 1.0.21", + "proc-macro2", + "quote", "serde", - "syn 1.0.99", + "syn", "toml", "uniffi_build", "uniffi_meta", @@ -4785,9 +4582,9 @@ dependencies = [ "bumpalo", "log", "once_cell", - "proc-macro2 1.0.43", - "quote 1.0.21", - "syn 1.0.99", + "proc-macro2", + "quote", + "syn", "wasm-bindgen-shared", ] @@ -4809,7 +4606,7 @@ version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b260f13d3012071dfb1512849c033b1925038373aea48ced3012c09df952c602" dependencies = [ - "quote 1.0.21", + "quote", "wasm-bindgen-macro-support", ] @@ -4819,9 +4616,9 @@ version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5be8e654bdd9b79216c2929ab90721aa82faf65c48cdf08bdc4e7f51357b80da" dependencies = [ - "proc-macro2 1.0.43", - "quote 1.0.21", - "syn 1.0.99", + "proc-macro2", + "quote", + "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4852,8 +4649,8 @@ version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6150d36a03e90a3cf6c12650be10626a9902d70c5270fd47d7a47e5389a10d56" dependencies = [ - "proc-macro2 1.0.43", - "quote 1.0.21", + "proc-macro2", + "quote", ] [[package]] @@ -5090,8 +4887,8 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f8f187641dad4f680d25c4bfc4225b418165984179f26ca76ec4fb6441d3a17" dependencies = [ - "proc-macro2 1.0.43", - "quote 1.0.21", - "syn 1.0.99", + "proc-macro2", + "quote", + "syn", "synstructure", ] From a0edd2f8d85fc5a5a6e7620e6085be7fdf3882db Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Mon, 12 Sep 2022 12:41:17 +0200 Subject: [PATCH 3/3] test(qrcode): Restore `image` only for one test. --- Cargo.lock | 128 ++++++++++++++++++++++++++-- crates/matrix-sdk-qrcode/Cargo.toml | 4 + crates/matrix-sdk-qrcode/README.md | 4 +- 3 files changed, 125 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 29053d97c..def495f71 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,6 +17,12 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "adler32" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" + [[package]] name = "aead" version = "0.4.3" @@ -272,7 +278,7 @@ dependencies = [ "cc", "cfg-if", "libc", - "miniz_oxide", + "miniz_oxide 0.5.4", "object", "rustc-demangle", ] @@ -931,6 +937,16 @@ dependencies = [ "uuid 1.1.2", ] +[[package]] +name = "deflate" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73770f8e1fe7d64df17ca66ad28994a0a623ea497fa69486e14984e715c5d174" +dependencies = [ + "adler32", + "byteorder", +] + [[package]] name = "der" version = "0.5.1" @@ -1340,7 +1356,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" dependencies = [ "crc32fast", - "miniz_oxide", + "miniz_oxide 0.5.4", ] [[package]] @@ -1815,6 +1831,25 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "image" +version = "0.23.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24ffcb7e7244a9bf19d35bf2883b9c080c4ced3c07a9895572178cdb8f13f6a1" +dependencies = [ + "bytemuck", + "byteorder", + "color_quant", + "gif", + "jpeg-decoder 0.1.22", + "num-iter", + "num-rational 0.3.2", + "num-traits", + "png 0.16.8", + "scoped_threadpool", + "tiff 0.6.1", +] + [[package]] name = "image" version = "0.24.3" @@ -1825,12 +1860,12 @@ dependencies = [ "byteorder", "color_quant", "gif", - "jpeg-decoder", - "num-rational", + "jpeg-decoder 0.2.6", + "num-rational 0.4.1", "num-traits", - "png", + "png 0.17.6", "scoped_threadpool", - "tiff", + "tiff 0.7.3", ] [[package]] @@ -1948,6 +1983,15 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" +[[package]] +name = "jpeg-decoder" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "229d53d58899083193af11e15917b5640cd40b29ff475a1fe4ef725deb02d0f2" +dependencies = [ + "rayon", +] + [[package]] name = "jpeg-decoder" version = "0.2.6" @@ -2084,7 +2128,7 @@ dependencies = [ "futures-util", "getrandom 0.2.7", "http", - "image", + "image 0.24.3", "matches", "matrix-sdk-base", "matrix-sdk-common", @@ -2359,6 +2403,7 @@ version = "0.3.0" dependencies = [ "base64", "byteorder", + "image 0.23.14", "qrcode", "ruma-common", "thiserror", @@ -2481,6 +2526,25 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" +[[package]] +name = "miniz_oxide" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "791daaae1ed6889560f8c4359194f56648355540573244a5448a83ba1ecc7435" +dependencies = [ + "adler32", +] + +[[package]] +name = "miniz_oxide" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" +dependencies = [ + "adler", + "autocfg", +] + [[package]] name = "miniz_oxide" version = "0.5.4" @@ -2627,6 +2691,28 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-iter" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + [[package]] name = "num-rational" version = "0.4.1" @@ -2938,6 +3024,18 @@ dependencies = [ "plotters-backend", ] +[[package]] +name = "png" +version = "0.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c3287920cb847dee3de33d301c463fba14dda99db24214ddf93f83d3021f4c6" +dependencies = [ + "bitflags", + "crc32fast", + "deflate", + "miniz_oxide 0.3.7", +] + [[package]] name = "png" version = "0.17.6" @@ -2947,7 +3045,7 @@ dependencies = [ "bitflags", "crc32fast", "flate2", - "miniz_oxide", + "miniz_oxide 0.5.4", ] [[package]] @@ -3091,6 +3189,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16d2f1455f3630c6e5107b4f2b94e74d76dea80736de0981fd27644216cff57f" dependencies = [ "checked_int_cast", + "image 0.23.14", ] [[package]] @@ -4032,6 +4131,17 @@ dependencies = [ "once_cell", ] +[[package]] +name = "tiff" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a53f4706d65497df0c4349241deddf35f84cee19c87ed86ea8ca590f4464437" +dependencies = [ + "jpeg-decoder 0.1.22", + "miniz_oxide 0.4.4", + "weezl", +] + [[package]] name = "tiff" version = "0.7.3" @@ -4039,7 +4149,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7259662e32d1e219321eb309d5f9d898b779769d81b76e762c07c8e5d38fcb65" dependencies = [ "flate2", - "jpeg-decoder", + "jpeg-decoder 0.2.6", "weezl", ] diff --git a/crates/matrix-sdk-qrcode/Cargo.toml b/crates/matrix-sdk-qrcode/Cargo.toml index 79b9a1657..ff2e93178 100644 --- a/crates/matrix-sdk-qrcode/Cargo.toml +++ b/crates/matrix-sdk-qrcode/Cargo.toml @@ -25,3 +25,7 @@ thiserror = "1.0.30" [dependencies.vodozemac] git = "https://github.com/matrix-org/vodozemac/" rev = "ad1f098aff2a0b69aa5822c4e0679089a9fa4a86" + +[dev-dependencies] +image = "0.23.0" +qrcode = { version = "0.12.0", default-features = false, features = ["image"] } diff --git a/crates/matrix-sdk-qrcode/README.md b/crates/matrix-sdk-qrcode/README.md index 05c3e5a9c..2110522d8 100644 --- a/crates/matrix-sdk-qrcode/README.md +++ b/crates/matrix-sdk-qrcode/README.md @@ -12,7 +12,7 @@ If you still want to play with QR codes, here is a helpful example. ```rust,no_run use matrix_sdk_qrcode::{QrVerificationData, DecodingError}; -//use image::Luma; +use image::Luma; fn main() -> Result<(), DecodingError> { let data = b"MATRIX\ @@ -24,7 +24,7 @@ fn main() -> Result<(), DecodingError> { let data = QrVerificationData::from_bytes(data)?; let encoded = data.to_qr_code().unwrap(); - //let image = encoded.render::>().build(); + let image = encoded.render::>().build(); Ok(()) }