Mercurial > hg > orthanc-tests
changeset 345:4d3b797aa5ae
fix
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 19 Oct 2020 19:15:59 +0200 |
parents | c55f2e4a0cce |
children | a56cbcbacfde |
files | Plugins/DicomWeb/Run.py |
diffstat | 1 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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: