Skip to content

Commit

Permalink
Fix comparison when layout differs
Browse files Browse the repository at this point in the history
In case `layoutDifference` is `true` `compColor` is assigned incorrect
pixel value read from `base` instead of `comp`.
  • Loading branch information
serpent7776 committed Oct 2, 2024
1 parent 93dd425 commit ab3aa9f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Diff.ml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ module MakeDiff (IO1 : ImageIO.ImageIO) (IO2 : ImageIO.ImageIO) = struct
if alpha <> Int32.zero then countDifference !x !y)
else
let compColor =
if layoutDifference then IO1.readRawPixel ~x:!x ~y:!y base
if layoutDifference then IO2.readRawPixel ~x:!x ~y:!y comp
else IO2.readRawPixelAtOffset offset comp
in

Expand Down

0 comments on commit ab3aa9f

Please sign in to comment.