Ah, thanks, Brian, so the issue is that Catalina is now embedding Exif tags 
while previous versions didn’t. Tcltk never supported them, but it only came up 
now as Catalina is generating them. I’ll check if tcltk has ever fixed it.

Sent from my iPhone

> On 12 Jun 2020, at 19:00, Prof Brian Ripley <rip...@stats.ox.ac.uk> wrote:
> 
>> On 12/06/2020 03:49, Fox, John wrote:
>> Dear Simon,
>>> On Jun 11, 2020, at 9:00 PM, Simon Urbanek <simon.urba...@r-project.org> 
>>> wrote:
>>> 
>>> Wayne,
>>> 
>>> that one is unrelated, but interesting - you can fix it with
>>> 
>>> sudo install_name_tool -change \
>>>  /usr/local/lib:/opt/X11/lib/libtk8.6.dylib \
>>>  /usr/local/lib/libtk8.6.dylib \
>>>  /usr/local/bin/wish8.6
>>> 
>>> There is a bug in tcltk with IDs on the libraries which I have 
>>> worked-around for R, but not for wish.
>>> 
>>> Back to the original question - do you have any example of a file that 
>>> doesn't work so I could test? Exif chunks are fairly rare in PNG and are a 
>>> more late extension so I couldn't find any examples.
>> The code in Wayne's original message (copied below) generated the offending 
>> file:
>> library(tcltk)
>> fname <- "Rplot.png"
>> png(filename = fname, width = 500, height = 500)
>> hist(rnorm(20))
>> dev.off()
>> tkimage.create("photo", file = fname)
> 
> There are several png() devices for R.  The default on macOS is to use 
> Quartz, and that depends on macOS system functions so might well have changed 
> with Mojave -> Catalina.
> 
> As a workaround, try e.g. png(type='cairo').  E.g.
> 
> fname <- file.path(tempdir(), "Rplot.png")
> png(filename = fname, width = 500, height = 500, type="cairo")
> hist(rnorm(20))
> dev.off()
> 
> library(tcltk)
> tkimage.create("photo", file = fname)
> 
> works for me on Catalina.
> 
> 
> -- 
> Brian D. Ripley,                  rip...@stats.ox.ac.uk
> Emeritus Professor of Applied Statistics, University of Oxford
> 

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to