From @hot@och|1990 @end|ng |rom gm@||@com  Thu Jul  9 22:21:06 2020
From: @hot@och|1990 @end|ng |rom gm@||@com (=?UTF-8?B?44Kq44OB44K344On44Km44K/?=)
Date: Fri, 10 Jul 2020 05:21:06 +0900
Subject: [Rd] Is this surprising behavior of tkimage.create function a bug?
Message-ID: <CANOYX1QL4N=9gYTCDTy3pwHWHCB33rpJ67ABMJeoF-VHUFNY-w@mail.gmail.com>

tkimage.create function can read some images but can't read the other
images.
We can reproduce it by running the code below.
-------------------------------------------------------------------------------------
library(tcltk)
library(magick)

# works fine
tmp <- tempfile(fileext = ".gif")
image_write(logo, tmp)
image_tcl <- tkimage.create("photo", "image_tcl", file = tmp)

# doesn't work fine
logo2 <- image_convert(logo, format = "jpeg")
tmp2 <- tempfile(fileext = ".jpg")
image_write(logo2, tmp2)
image_tcl <- tkimage.create("photo", "image_tcl2", file = tmp2)
------------------------------------------------------------------------------------

The last line returns an error below.
> Error in structure(.External(.C_dotTclObjv, objv), class = "tclObj") :
  [tcl] couldn't recognize data in image file
"C:\Users\shota\AppData\Local\Temp\RtmpmmOriu\filed04c9e079d4.jpg".

Is this a bug?

 My session info is shown below.
> R Under development (unstable) (2020-07-08 r78794)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)

Matrix products: default

locale:
[1] LC_COLLATE=Japanese_Japan.932  LC_CTYPE=Japanese_Japan.932
[3] LC_MONETARY=Japanese_Japan.932 LC_NUMERIC=C
[5] LC_TIME=Japanese_Japan.932

attached base packages:
[1] tcltk     stats     graphics  grDevices utils     datasets
[7] methods   base

other attached packages:
[1] magick_2.4.0

loaded via a namespace (and not attached):
[1] compiler_4.1.0 magrittr_1.5   Rcpp_1.0.5

	[[alternative HTML version deleted]]



[Rd] Is this surprising behavior of tkimage.create function a bug?
=?UTF-8?B?44Kq44OB44K344On44Km44K/?=