Browse code

Commit made by the Bioconductor Git-SVN bridge.

Commit id: da1e9c85367cf00f37ee72a3a5e938f03db5b164

fixed windows compile issue



git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/ggtree@100099 bc3139a8-67e5-0310-9ffc-ced21a209358

g.yu authored on 03/03/2015 11:55:22
Showing 3 changed files

... ...
@@ -1,7 +1,7 @@
1 1
 Package: ggtree
2 2
 Type: Package
3 3
 Title: a phylogenetic tree viewer for different types of tree annotations
4
-Version: 0.99.20
4
+Version: 0.99.21
5 5
 Author: Guangchuang Yu
6 6
 Maintainer: Guangchuang Yu <guangchuangyu@gmail.com>
7 7
 Description: ggtree extends the ggplot2 plotting system which implemented the
... ...
@@ -1,8 +1,6 @@
1
-CHANGES IN VERSION 0.99.20
1
+CHANGES IN VERSION 0.99.21
2 2
 ------------------------
3
- o change .png to .PNG for WINDOWS platform <2015-03-01, Sun>
4
-   	  Error: processing vignette 'ggtree.Rmd' failed with diagnostics:
5
-   	  file is not in PNG format
3
+ o fixed downloading png file in Windows platform, should explicitly setting mode="wb". <2015-03-03, Tue>
6 4
  
7 5
 CHANGES IN VERSION 0.99.19
8 6
 ------------------------
... ...
@@ -33,8 +33,12 @@ download.phylopic <- function(id, size=512, color="black", alpha=1) {
33 33
         match.arg(c("64", "128", "256", "512", "1024"))
34 34
 
35 35
     imgurl <- paste0("http://phylopic.org/assets/images/submissions/", id, ".", size, ".png")
36
-    imgfile <- tempfile(fileext = ".PNG") ## .png is not recognize by WINDOWS platform
37
-    download.file(imgurl, imgfile, quiet = TRUE)
36
+    imgfile <- tempfile(fileext = ".png") 
37
+    if (Sys.info()["sysname"] == "Windows") {
38
+        download.file(imgurl, imgfile, mode="wb", quiet = TRUE)
39
+    } else {
40
+        download.file(imgurl, imgfile, quiet = TRUE)
41
+    }
38 42
     img <- readImage(imgfile)
39 43
        
40 44
     color <- col2rgb(color) / 255