Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Cargo.toml and bump version to 0.3.0 #34

Merged
merged 2 commits into from
Jun 6, 2023
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
run: cargo test --release --verbose
- name: Run check
run: cargo check --verbose
- name: Run clippy
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description = "A flexible rule-based file and folder comparison tool and crate i
repository = "https://github.com/VolumeGraphics/havocompare"
homepage = "https://github.com/VolumeGraphics/havocompare"
documentation = "https://docs.rs/havocompare"
version = "0.3.0-beta1"
version = "0.3.0"
edition = "2021"
license = "MIT"
authors = ["Volume Graphics GmbH"]
Expand All @@ -27,7 +27,7 @@ schemars_derive = "0.8"
thiserror = "1.0"
regex = "1.6"
image = "0.24"
image-compare = "0.3.0-beta1"
image-compare = "0.3.0"
tracing = "0.1"
tracing-subscriber = "0.3"
serde_json = "1.0"
Expand Down
11 changes: 4 additions & 7 deletions src/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use schemars_derive::JsonSchema;
use serde::{Deserialize, Serialize};
use std::path::{Path, PathBuf};
use thiserror::Error;
use tracing::{error, info};
use tracing::error;

#[derive(JsonSchema, Deserialize, Serialize, Debug)]
/// Image comparison config options
Expand Down Expand Up @@ -55,12 +55,9 @@ pub fn compare_paths<P: AsRef<Path>>(
let out_path = (nominal_file_name + "diff_image.png").to_string();

if result.score < config.threshold {
if let Some(color_map) = result.image.as_ref().map(|i| i.to_color_map()) {
info!("Writing diff image to: {}", out_path.as_str());
color_map.save(PathBuf::from(&out_path))?;
} else {
error!("Algorithm did not produce compare-image, so we cannot save it.");
}
let color_map = result.image.to_color_map();
color_map.save(PathBuf::from(&out_path))?;

let error_message = format!(
"Diff for image {} was not met, expected {}, found {}",
nominal_path.as_ref().to_string_lossy(),
Expand Down
Loading