Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "imageproc"
version = "0.26.0"
authors = ["theotherphil"]
rust-version = "1.82.0"
rust-version = "1.85.1"
edition = "2021"
license = "MIT"
description = "Image processing operations"
Expand Down Expand Up @@ -46,6 +46,10 @@ assert_approx_eq = "1.1.0"
proptest = "1.4.0"
wasm-bindgen-test = "0.3.38"

[build-dependencies]
cargo_metadata = "0.23"
semver = "1.0.27"

[package.metadata.docs.rs]
# See https://github.com/image-rs/imageproc/issues/358
# all-features = true
Expand Down
22 changes: 22 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
use cargo_metadata::MetadataCommand;
use semver::Version;

fn main() {
println!("cargo::rustc-check-cfg=cfg(lagacy_image)");
println!("cargo:rerun-if-changed=Cargo.lock");

let metadata = MetadataCommand::new()
.exec()
.expect("Failed to fetch metadata");

let image_version = &metadata
.packages
.iter()
.find(|p| p.name == "image")
.expect("image crate not found in dependencies")
.version;

if image_version < &Version::parse("0.25.8").unwrap() {
println!("cargo:rustc-cfg=lagacy_image");
}
}
Binary file added tests/data/legacy/antialiased_lines_rgb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/data/legacy/cubic_bezier_curve.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/data/legacy/elephant_affine_bicubic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/data/legacy/elephant_affine_bilinear.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/data/legacy/elephant_affine_nearest.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/data/legacy/elephant_gradients.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/data/legacy/elephant_matched.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/data/legacy/elephant_rotate_bicubic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/data/legacy/elephant_rotate_bilinear.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/data/legacy/elephant_rotate_nearest.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/data/legacy/filled_ellipse.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/data/legacy/flood_filled_shape.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/data/legacy/hollow_ellipse.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/data/legacy/hough_lines.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/data/legacy/lumaphant_bilateral.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/data/legacy/lumaphant_eq.png
Binary file added tests/data/legacy/polygon.png
Binary file added tests/data/legacy/polygon_antialiased.png
Binary file added tests/data/legacy/polygon_hollow.png
Binary file added tests/data/legacy/robin_sharpen3x3.png
Binary file added tests/data/legacy/robin_sharpen_gaussian.png
Binary file added tests/data/legacy/spiral_polygon.png
Binary file added tests/data/legacy/text.png
Binary file added tests/data/legacy/zebra_adaptive_threshold.png
Binary file added tests/data/legacy/zebra_canny.png
Binary file added tests/data/legacy/zebra_gaussian_10.png
Binary file added tests/data/legacy/zebra_gaussian_3.png
Binary file added tests/data/legacy/zebra_otsu.png
Binary file modified tests/data/truth/antialiased_lines_rgb.png
Binary file modified tests/data/truth/cubic_bezier_curve.png
Binary file modified tests/data/truth/elephant_affine_bicubic.png
Binary file modified tests/data/truth/elephant_affine_bilinear.png
Binary file modified tests/data/truth/elephant_affine_nearest.png
Binary file modified tests/data/truth/elephant_gradients.png
Binary file modified tests/data/truth/elephant_matched.png
Binary file modified tests/data/truth/elephant_rotate_bicubic.png
Binary file modified tests/data/truth/elephant_rotate_bicubic_rgba.png
Binary file modified tests/data/truth/elephant_rotate_bilinear.png
Binary file modified tests/data/truth/elephant_rotate_bilinear_rgba.png
Binary file modified tests/data/truth/elephant_rotate_nearest.png
Binary file modified tests/data/truth/elephant_rotate_nearest_rgba.png
Binary file modified tests/data/truth/filled_ellipse.png
Binary file modified tests/data/truth/flood_filled_shape.png
Binary file modified tests/data/truth/hollow_ellipse.png
Binary file modified tests/data/truth/hough_lines.png
Binary file modified tests/data/truth/lumaphant_bilateral.png
Binary file modified tests/data/truth/lumaphant_eq.png
Binary file modified tests/data/truth/polygon.png
Binary file modified tests/data/truth/polygon_antialiased.png
Binary file modified tests/data/truth/polygon_hollow.png
Binary file modified tests/data/truth/robin_sharpen3x3.png
Binary file modified tests/data/truth/robin_sharpen_gaussian.png
Binary file modified tests/data/truth/spiral_polygon.png
Binary file modified tests/data/truth/text.png
Binary file modified tests/data/truth/zebra_adaptive_threshold.png
Binary file modified tests/data/truth/zebra_canny.png
Binary file modified tests/data/truth/zebra_gaussian_10.png
Binary file modified tests/data/truth/zebra_gaussian_3.png
Binary file modified tests/data/truth/zebra_otsu.png
6 changes: 5 additions & 1 deletion tests/regression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ use imageproc::{
const INPUT_DIR: &str = "./tests/data";

/// The directory containing the truth images to compare against test outputs.
const TRUTH_DIR: &str = "./tests/data/truth";
const TRUTH_DIR: &str = if cfg!(lagacy_image) {
"./tests/data/legacy"
} else {
"./tests/data/truth"
};

// If the REGENERATE environment variable is set then running tests will update the truth files
// to match the output of the current code.
Expand Down
Loading