vcs icon indicating copy to clipboard operation
vcs copied to clipboard

Smeared image after resize on OSX (offscreen mode)

Open scottwittenburg opened this issue 8 years ago • 5 comments

Here is a short script to reproduce:

python

import vcs, cdms2, os

vcs.download_sample_data_files()

# offscreen mode 
bg = 1
modeStr = 'offscreen' if bg is 1 else 'onscreen'

# An example demonstrating patterns with meshfill
cltfile = cdms2.open(os.path.join(vcs.sample_data, 'clt.nc'))
clt = cltfile('clt')

# Initialize at one size
canvas = vcs.init(geometry={'width': 800, 'height': 600}, bg=bg)

box = canvas.createboxfill()

box.boxfill_type = 'custom'
box.fillareastyle = 'hatch'
# Refer to http://uvcdat.llnl.gov/examples/pattern_chart.html for a list of patterns
box.fillareaindices = [1, 2, 3, 4, 5]
box.fillareaopacity = [50.0, 85.1, 23.5, 99.9, 100]
box.levels = [0, 20, 40, 60, 80, 100]
box.fillareacolors = vcs.getcolors(box.levels)

canvas.plot(clt, box)

canvas.png('smear_expected_%s' % modeStr)

# Now resize
canvas.geometry(600, 400)

canvas.png('smear_smeared_%s' % modeStr)

This seems to work fine everywhere in onscreen mode (bg=0). However, on OSX only, and in offscreen mode (bg=1), the resized image seems to be smeared vertically near the bottom of the image. See attached screenshot:

smear_smeared_offscreen

scottwittenburg avatar Feb 05 '18 17:02 scottwittenburg

Ping @danlipsa @aashish24 @sankhesh @charlesdoutriaux in case any of you may have seen something like this before.

scottwittenburg avatar Feb 05 '18 17:02 scottwittenburg

I have mesalib installed and it works fine.

doutriaux1 avatar Feb 05 '18 17:02 doutriaux1

I can confirm that w/o mesa I get the same thing as @scottwittenburg

doutriaux1 avatar Feb 05 '18 17:02 doutriaux1

Looks a lot llike this. https://github.com/UV-CDAT/cdms/issues/208 https://github.com/UV-CDAT/cdms/issues/208#issuecomment-359931987

dnadeau4 avatar Feb 05 '18 17:02 dnadeau4

I thought so too at first, but I think it's different, in the issue https://github.com/UV-CDAT/cdms/issues/208#issuecomment-359931987 the regridder smears the data, here there's no regridder involved.

doutriaux1 avatar Feb 05 '18 17:02 doutriaux1