{"action":"opened","issue":{"url":"https://api.github.com/repos/dahtah/imager/issues/64","repository_url":"https://api.github.com/repos/dahtah/imager","labels_url":"https://api.github.com/repos/dahtah/imager/issues/64/labels{/name}","comments_url":"https://api.github.com/repos/dahtah/imager/issues/64/comments","events_url":"https://api.github.com/repos/dahtah/imager/issues/64/events","html_url":"https://github.com/dahtah/imager/issues/64","id":342962611,"node_id":"MDU6SXNzdWUzNDI5NjI2MTE=","number":64,"title":"load.image failed to load image from URL on windows","user":{"login":"ShotaOchi","id":26920335,"node_id":"MDQ6VXNlcjI2OTIwMzM1","avatar_url":"https://avatars3.githubusercontent.com/u/26920335?v=4","gravatar_id":"","url":"https://api.github.com/users/ShotaOchi","html_url":"https://github.com/ShotaOchi","followers_url":"https://api.github.com/users/ShotaOchi/followers","following_url":"https://api.github.com/users/ShotaOchi/following{/other_user}","gists_url":"https://api.github.com/users/ShotaOchi/gists{/gist_id}","starred_url":"https://api.github.com/users/ShotaOchi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShotaOchi/subscriptions","organizations_url":"https://api.github.com/users/ShotaOchi/orgs","repos_url":"https://api.github.com/users/ShotaOchi/repos","events_url":"https://api.github.com/users/ShotaOchi/events{/privacy}","received_events_url":"https://api.github.com/users/ShotaOchi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-20T03:41:22Z","updated_at":"2018-07-20T03:41:22Z","closed_at":null,"author_association":"NONE","body":"I tried to load a image from URL as shown below.\r\n###########################################-\r\nlibrary(imager)\r\n a <- load.image(\"https://cran.r-project.org/Rlogo.jpg\")\r\n###########################################-\r\n\r\nThe code caused the following error for the first time.\r\n------------------------------------------------------------------------------------------------------------------#\r\nError in load_image(file) : \r\n  cimg::stderr(): Reference to 'stderr' stream not allowed in R mode ('cimg_use_r' is defined).\r\n------------------------------------------------------------------------------------------------------------------#\r\n\r\nThe code caused the following error from next time.\r\n------------------------------------------------------------------------------------------------------------------#\r\nError in load_image(file) : \r\n  [instance(0,0,0,0,0000000000000000,non-shared)] CImg<double>::load(): Failed to recognize format of file 'C:\\Users\\user_name\\AppData\\Local\\Temp\\RtmpszXASx\\file24346a0a7022'.\r\n------------------------------------------------------------------------------------------------------------------#\r\n\r\nThe errors occurred on windows 10 and windows 7.\r\nThe errors didn't occur on Ubuntu.\r\n\r\nThe error from second time said that load_image failed to recognize the format of the temporary file.\r\nSo, a modification of wrap.url as shown below should fix it.\r\nThe modification appears in bold type.\r\n###########################################-\r\nwrap.url <- function(file,fun)\r\n{\r\n    is.url <- grepl(\"^(http|ftp)s?://\", file)\r\n    if (is.url)\r\n    {\r\n        url <- file\r\n       **ext <- gsub(\".*\\\\.\", \".\",  url)** \r\n        file <- tempfile(**fileext = ext**)\r\n        downloader::download(url,file)\r\n###########################################-\r\n\r\nI don't understand how to fix the error for the first time.\r\nIt seems that cimg tried to open the standard error stream.\r\nBut I have no idea how to fix the error."}}
{"actor":{"display_login":"ShotaOchi"}}