# HG changeset patch # User russes02 # Date 1340818851 14400 # Wed Jun 27 13:40:51 2012 -0400 # Node ID 2021f40942d7d2c45614a7b6f838b91e215fa050 # Parent 71e00b895e372afbfe2244e97a6de5a6de9bc85a Fixed a bug in the comparison algorithm that made all images of the same size look the same. diff --git a/metric.go b/metric.go --- a/metric.go +++ b/metric.go @@ -137,13 +137,12 @@ return false } - dim := w * h identical := true for ix := 0; ix < w; ix++ { for iy := 0; iy < h; iy++ { ca := args.ImgA.At(ix, iy).(color.RGBA) cb := args.ImgB.At(ix, iy).(color.RGBA) - if ca.R != cb.R && ca.G != cb.G && ca.B != cb.B && ca.A != cb.A { + if ca.R != cb.R || ca.G != cb.G || ca.B != cb.B || ca.A != cb.A { identical = false break } @@ -154,6 +153,7 @@ return true } + dim := w * h // assuming colorspaces are in Adobe RGB (1998) convert to XYZ aX := make([]float64, dim) aY := make([]float64, dim) diff --git a/pdiff/main.go b/pdiff/main.go --- a/pdiff/main.go +++ b/pdiff/main.go @@ -25,7 +25,7 @@ "flag" "fmt" "os" - pdiff "hg.germane-software.com/perceptualdiff.hg" + pdiff "perceptualdiff" ) const copyright = `PerceptualDiff Go version 1.0.0