Skip to content

Commit

Permalink
Remove early size check requirement in OffByTwo.kt
Browse files Browse the repository at this point in the history
This will make `OffByTwo.kt` behaves identical to the original `PixelPerfect` differ.
But most importantly, it will restore the initial behavior of `ImageUtils.assertImageSimilar()` itself, checking for differences in size and correctly producing the expected delta (and actual) images in case of a size mismatch.

Relates to cashapp#1716
  • Loading branch information
SimonMarquis committed Feb 2, 2025
1 parent e1fd699 commit 29a24ea
Showing 1 changed file with 0 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import kotlin.math.max

internal object OffByTwo : Differ {
override fun compare(expected: BufferedImage, actual: BufferedImage): DiffResult {
check(expected.width == actual.width && expected.height == actual.height) { "Images are different sizes" }

val expectedWidth = expected.width
val expectedHeight = expected.height

Expand Down

0 comments on commit 29a24ea

Please sign in to comment.