Skip to content

Commit 67ec211

Browse files
committed
Converted the jpeg files used in image and pixel group tests to png.
The system jpeg library on the Mac is now different from that on Linux, and tests that rely on the exact RGB values of voxels will fail on one platform or the other (unless vtk on the Mac is compiled so that it uses its own jpeg library, instead of the system library). This is an attempt to avoid the problem entirely by using png files instead of jpeg.
1 parent 4fd423a commit 67ec211

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+58
-45
lines changed

TEST3D/image_test.py

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -290,16 +290,19 @@ def Load(self):
290290
depth_in_pixels=100)
291291
OOF.File.Load.Image(
292292
filenames=ThreeDImageDirectory(
293-
directory=reference_file("ms_data","jpeg"),
293+
# directory=reference_file("ms_data","jpeg"),
294+
directory=reference_file("ms_data","megavoxel"),
294295
sort=NumericalOrder()),
295296
microstructure="load_test",
296297
height=automatic, width=automatic, depth=automatic)
297298
ms = getMicrostructure("load_test")
298299
ms_images = ms.imageNames()
299300
self.assertEqual(len(ms_images),1)
300-
self.assert_("jpeg" in ms_images)
301+
# self.assert_("jpeg" in ms_images)
302+
self.assert_("megavoxel" in ms_images)
301303
# Check a few pixel values
302-
im = imagecontext.imageContexts['load_test:jpeg'].getObject()
304+
#im = imagecontext.imageContexts['load_test:jpeg'].getObject()
305+
im = imagecontext.imageContexts['load_test:megavoxel'].getObject()
303306
self.assertEqual(im[primitives.iPoint(0,0,0)],
304307
color.RGBColor(0.054901960784313725,
305308
0.996078431372549,
@@ -312,19 +315,25 @@ def Load(self):
312315
# pixel_test.py on Mac but not Linux. Apparently Mac and
313316
# Linux use different jpeg libraries which decompress images
314317
# differently. WTF?
315-
## TODO: Check that problem is avoided if vtk on Mac is
316-
## compiled with USE_SYSTEM_JPEG=OFF
318+
# The problem is avoided if vtk on Mac is
319+
# compiled with USE_SYSTEM_JPEG=OFF
317320
self.assertEqual(im[primitives.iPoint(16, 9, 99)],
318321
# Linux value
319-
color.RGBColor(
320-
0.3058823529411765,
321-
0.9921568627450981,
322-
0.7215686274509804)
322+
# color.RGBColor(
323+
# 0.3058823529411765,
324+
# 0.9921568627450981,
325+
# 0.7215686274509804)
323326
# Mac value
324327
# color.RGBColor(
325328
# 0.2901960784313726,
326329
# 1.0,
327330
# 0.7372549019607844)
331+
332+
# After converting to PNG
333+
color.RGBColor(
334+
0.2901960784313726,
335+
1.0,
336+
0.7372549019607844)
328337
)
329338

330339
## Check that an Image saved in a Microstructure data file is
1.41 KB
4.42 KB
4.91 KB
5.12 KB
5.53 KB
5.8 KB
6.75 KB
7.67 KB
8.01 KB

0 commit comments

Comments
 (0)