Skip to content

Commit

Permalink
Fix overflow in median hash
Browse files Browse the repository at this point in the history
  • Loading branch information
qarmin committed Oct 24, 2024
1 parent 18faef8 commit b8bfa7c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
# 3.0.0 - ?.?.?
- Fix difference of gaussians prefilter - [#21](https://github.com/qarmin/img_hash/pull/21)
- Fixed overflow in median hash

# 2.0.0 - 11.03.2024
- Update to image 0.25
- Minimal Rust version set to 1.67.1
- Added median hash - [#13](https://github.com/qarmin/img_hash/pull/13)
- Added bit ordering - [#14](https://github.com/qarmin/img_hash/pull/14)
- Added into_inner() function on ImageHash object - [#11](https://github.com/qarmin/img_hash/pull/11)

# 1.2.0 - 02.06.2023
- Update base64 to 0.21.0 - [#8](https://github.com/qarmin/img_hash/pull/8)

# 1.1.2 - 26.11.2022
- Revert base64 version to 0.13.1
- Set minimal Rust version to 1.61

# 1.1.1 - 20.11.2022
- Rustdct fix, criterion/benchmark update, tests fixes - [#3](https://github.com/qarmin/img_hash/pull/3)

# 1.1 - 20.10.2022
- Added CI, formatted code - [#2](https://github.com/qarmin/img_hash/pull/2)
- Update to rustdct 0.7 - [#1](https://github.com/qarmin/img_hash/pull/1)

# 1.0 - 02.04.2022
- First version without any logic changes with updated dependencies - [47e](47e4e243f79e170291580e2fb914b53b749cead6)
- Some clippy changes - [8da](8da30ed6e46697fa1ab99a664b579e51e62dc6ae)
2 changes: 1 addition & 1 deletion src/alg/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ fn median_u8(numbers: &[u8]) -> u8 {
if sorted.len() % 2 == 0 {
let a = sorted[mid - 1];
let b = sorted[mid];
(a + b) / 2
((a as u16 + b as u16) / 2) as u8
} else {
sorted[mid]
}
Expand Down

0 comments on commit b8bfa7c

Please sign in to comment.