diff --git a/.gitignore b/.gitignore index c751ac2..abe835c 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ /image-0.24.6.crate /image-0.24.7.crate /image-0.24.8.crate +/image-0.24.9.crate diff --git a/1269c12.patch b/1269c12.patch deleted file mode 100644 index 799fe4b..0000000 --- a/1269c12.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 1269c1210c88a5adfcc8104b5d41e6706d06607b Mon Sep 17 00:00:00 2001 -From: Jonathan Behrens -Date: Sat, 13 Jan 2024 19:52:12 -0500 -Subject: [PATCH] Fix reference tests on big endian (#2099) - ---- - tests/reference_images.rs | 28 +++++++++++++++++++++++++--- - 1 file changed, 25 insertions(+), 3 deletions(-) - -diff --git a/tests/reference_images.rs b/tests/reference_images.rs -index d07423f23f..015d6a6e09 100644 ---- a/tests/reference_images.rs -+++ b/tests/reference_images.rs -@@ -1,4 +1,5 @@ - //! Compares the decoding results with reference renderings. -+use std::convert::TryInto; - use std::fs; - use std::io; - use std::path::PathBuf; -@@ -270,14 +271,35 @@ fn check_references() { - - let test_crc_actual = { - let mut hasher = Crc32::new(); -- hasher.update(test_img.as_bytes()); -+ match test_img { -+ DynamicImage::ImageLuma8(_) -+ | DynamicImage::ImageLumaA8(_) -+ | DynamicImage::ImageRgb8(_) -+ | DynamicImage::ImageRgba8(_) => hasher.update(test_img.as_bytes()), -+ DynamicImage::ImageLuma16(_) -+ | DynamicImage::ImageLumaA16(_) -+ | DynamicImage::ImageRgb16(_) -+ | DynamicImage::ImageRgba16(_) => { -+ for v in test_img.as_bytes().chunks(2) { -+ hasher.update(&u16::from_ne_bytes(v.try_into().unwrap()).to_le_bytes()); -+ } -+ } -+ DynamicImage::ImageRgb32F(_) | DynamicImage::ImageRgba32F(_) => { -+ for v in test_img.as_bytes().chunks(4) { -+ hasher.update(&f32::from_ne_bytes(v.try_into().unwrap()).to_le_bytes()); -+ } -+ } -+ _ => panic!("Unsupported image format"), -+ } - hasher.finalize() - }; - - if test_crc_actual != case.crc { - panic!( -- "The decoded image's hash does not match (expected = {:08x}, actual = {:08x}).", -- case.crc, test_crc_actual -+ "{}: The decoded image's hash does not match (expected = {:08x}, actual = {:08x}).", -+ img_path.display(), -+ case.crc, -+ test_crc_actual - ); - } - diff --git a/14d4577.patch b/14d4577.patch deleted file mode 100644 index 10590ee..0000000 --- a/14d4577.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 14d45771a9820dd14cb1533505098225624d7250 Mon Sep 17 00:00:00 2001 -From: Jonathan Behrens -Date: Sat, 13 Jan 2024 20:33:24 -0500 -Subject: [PATCH] Avoid overflow in gif::Decoder::buffer_size (#2103) - ---- - src/codecs/gif.rs | 11 ++++++++--- - 1 file changed, 8 insertions(+), 3 deletions(-) - -diff --git a/src/codecs/gif.rs b/src/codecs/gif.rs -index 6f3f87d09c..8b6f5ee26f 100644 ---- a/src/codecs/gif.rs -+++ b/src/codecs/gif.rs -@@ -37,6 +37,8 @@ use gif::{DisposalMethod, Frame}; - - use crate::animation::{self, Ratio}; - use crate::color::{ColorType, Rgba}; -+use crate::error::LimitError; -+use crate::error::LimitErrorKind; - use crate::error::{ - DecodingError, EncodingError, ImageError, ImageResult, ParameterError, ParameterErrorKind, - UnsupportedError, UnsupportedErrorKind, -@@ -177,12 +179,15 @@ impl<'a, R: 'a + Read> ImageDecoder<'a> for GifDecoder { - } else { - // If the frame does not match the logical screen, read into an extra buffer - // and 'insert' the frame from left/top to logical screen width/height. -- let buffer_size = self.reader.buffer_size(); -+ let buffer_size = (frame.width as usize) -+ .checked_mul(frame.height as usize) -+ .and_then(|s| s.checked_mul(4)) -+ .ok_or(ImageError::Limits(LimitError::from_kind( -+ LimitErrorKind::InsufficientMemory, -+ )))?; - - self.limits.reserve_usize(buffer_size)?; -- - let mut frame_buffer = vec![0; buffer_size]; -- - self.limits.free_usize(buffer_size); - - self.reader diff --git a/image-fix-metadata.diff b/image-fix-metadata.diff index 342d080..7a77703 100644 --- a/image-fix-metadata.diff +++ b/image-fix-metadata.diff @@ -1,6 +1,6 @@ ---- image-0.24.8/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ image-0.24.8/Cargo.toml 2024-01-13T21:34:26.165667+00:00 -@@ -41,20 +41,6 @@ +--- image-0.24.9/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ image-0.24.9/Cargo.toml 2024-02-24T17:51:58.734154+00:00 +@@ -42,20 +42,6 @@ "--cfg", "docsrs", ] @@ -20,8 +20,8 @@ -harness = false [dependencies.bytemuck] - version = "1.7.0" -@@ -128,9 +114,6 @@ + version = "1.8.0" +@@ -129,9 +115,6 @@ [dev-dependencies.crc32fast] version = "1.2.0" @@ -31,7 +31,7 @@ [dev-dependencies.glob] version = "0.3" -@@ -175,7 +158,6 @@ +@@ -176,7 +159,6 @@ "dds", "farbfeld", "jpeg_rayon", diff --git a/rust-image.spec b/rust-image.spec index 86a9120..d0a1409 100644 --- a/rust-image.spec +++ b/rust-image.spec @@ -1,26 +1,21 @@ -# Generated by rust2rpm 25 +# Generated by rust2rpm 26 %bcond_without check %global debug_package %{nil} %global crate image Name: rust-image -Version: 0.24.8 +Version: 0.24.9 Release: %autorelease Summary: Imaging library -License: MIT +License: MIT OR Apache-2.0 URL: https://crates.io/crates/image Source: %{crates_source} # Manually created patch for downstream crate metadata changes # * drop unused, benchmark-only criterion dev-dependency # * disable little-endian-only openexr feature Patch: image-fix-metadata.diff -# * include upstream patches to fix issues on s390x and i686: -# https://github.com/image-rs/image/issues/2097 -# https://github.com/image-rs/image/issues/2098 -Patch: https://github.com/image-rs/image/commit/14d4577.patch -Patch: https://github.com/image-rs/image/commit/1269c12.patch BuildRequires: cargo-rpm-macros >= 24 @@ -40,7 +35,8 @@ This package contains library source intended for building other packages which use the "%{crate}" crate. %files devel -%license %{crate_instdir}/LICENSE +%license %{crate_instdir}/LICENSE-APACHE +%license %{crate_instdir}/LICENSE-MIT %doc %{crate_instdir}/CHANGES.md %doc %{crate_instdir}/README.md %{crate_instdir}/ @@ -265,7 +261,7 @@ use the "webp" feature of the "%{crate}" crate. %if %{with check} %check # * skip tests with missing test files (not included in published crates) -%cargo_test -- -- --exact --skip codecs::bmp::decoder::test::read_rect --skip codecs::png::tests::ensure_no_decoder_off_by_one --skip codecs::png::tests::underlying_error --skip codecs::qoi::tests::decode_test_image --skip dynimage::test::image_dimensions --skip dynimage::test::open_16bpc_png --skip imageops::sample::tests::resize_transparent_image --skip imageops::sample::tests::test_resize_same_size --skip imageops::sample::tests::test_sample_bilinear --skip imageops::sample::tests::test_sample_nearest --skip codecs::bmp::decoder::test::test_no_header --skip tiff +%cargo_test -- -- --exact --skip codecs::bmp::decoder::test::read_rect --skip codecs::png::tests::ensure_no_decoder_off_by_one --skip codecs::png::tests::underlying_error --skip codecs::qoi::tests::decode_test_image --skip dynimage::test::image_dimensions --skip dynimage::test::open_16bpc_png --skip imageops::sample::tests::resize_transparent_image --skip imageops::sample::tests::test_resize_same_size --skip imageops::sample::tests::test_sample_bilinear --skip imageops::sample::tests::test_sample_nearest --skip codecs::bmp::decoder::test::test_no_header %endif %changelog diff --git a/sources b/sources index cb1ce17..8e0ee24 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (image-0.24.8.crate) = 808c25e1b2308b25afa727cf510ee5b5398cc3948e647eea7cd4e651857d158462190a39c2e1d5279c8c7a5144efdcf1943e311504a404d801de76d05692a88e +SHA512 (image-0.24.9.crate) = 3f858efceeed54e21543eee065ca6008f40c568e1ece1016b38040eff5625c9fb6de77c7e950c08c9e82b9fcbd4c4ec2f8c4c1157ed5d232bc8e35b4850420d2