Binding Picture.source

Hi,

I’m upgrade from v1.4.8 to v1.4.23 and noticed that a few changes to how Picture.source works have been made.

Setting Picture.source now conditionally sets the crossOrigin flag on the generated image. It is set to "anonymous" unless it is served from a data URI or the local filesystem (it will keep the default null value).


I am binding the source of my Picture to an SVG uri via
<span =“Apple-tab-span” style=“white-space:pre”> $go(go.Picture,
{ maxSize: new go.Size(150, 150), alignment: go.Spot.Center },
new go.Binding(“source”, “img”))
)
This worked fine in v1.4.8, but now that I’ve updated to v1.4.23, none of my images appear and I’m receiving 401 (Unauthorized) errors in Chrome debugger for each SVG.

I’m wondering if there is a known solution to this issue?

Thanks,

  • Tim

Please add this sourceCrossOrigin property (a definable function) so that it returns null:

$go(go.Picture,
{ maxSize: new go.Size(150, 150), alignment: go.Spot.Center,
sourceCrossOrigin: function() { return null; }
},
new go.Binding(“source”, “img”))
)

Does that fix the issue?

Sorry about that, we’ve been experimenting with “good” defaults for cross origin requests, but have run into some unexpected scenarios along the way.

That did fix the issue. Thank you very much!