# HG changeset patch # User Sebastien Jodogne # Date 1603127759 -7200 # Node ID 4d3b797aa5aeeaf1c48ebd4853f0154c76bc22db # Parent c55f2e4a0ccedc760a67193c3a533d38bd88d898 fix diff -r c55f2e4a0cce -r 4d3b797aa5ae Plugins/DicomWeb/Run.py --- a/Plugins/DicomWeb/Run.py Fri Oct 16 11:13:09 2020 +0200 +++ b/Plugins/DicomWeb/Run.py Mon Oct 19 19:15:59 2020 +0200 @@ -1372,13 +1372,19 @@ # The following fails in DICOMweb plugin <= 1.2, as "/rendered" # was redirecting to the "/preview" route of Orthanc # http://effbot.org/zone/pil-comparing-images.htm - self.assertTrue(ImageChops.difference(im2, truth).getbbox() is None) self.assertTrue(ImageChops.difference(im1, im3).getbbox() is None) self.assertTrue(ImageChops.difference(im1, im5).getbbox() is None) self.assertTrue(ImageChops.difference(im2, im4).getbbox() is None) self.assertTrue(ImageChops.difference(im2, im6).getbbox() is None) self.assertTrue(ImageChops.difference(im3, im5).getbbox() is None) self.assertTrue(ImageChops.difference(im4, im6).getbbox() is None) + + # Tolerance of just 1 pixel of difference (needed on Windows) + #print(im2.getpixel((238,275))) # => 255 + #print(truth.getpixel((238,275))) # => 254 + bbox = ImageChops.difference(im2, truth).getbbox() + self.assertLessEqual(abs(bbox[2] - bbox[0]), 1) + self.assertLessEqual(abs(bbox[3] - bbox[1]), 1) try: