Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

posting a PNG? #4

Closed
tdhock opened this issue Jun 6, 2014 · 3 comments
Closed

posting a PNG? #4

tdhock opened this issue Jun 6, 2014 · 3 comments

Comments

@tdhock
Copy link

tdhock commented Jun 6, 2014

I would like to post a PNG to a gist but I am getting the following error

> gist_create("/tmp/RtmpQZytoH/file2f9877e26e34/thumbnail.png")
Loading required package: rjson
Error in content(response)$html_url (from gist.R#78) : 
  $ operator is invalid for atomic vectors
In addition: Warning messages:
1: client error: (400) Bad Request 
2: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called ‘rjson’

the image I tried to upload is below -- I uploaded it using git clone, git add, git commit, git push .

https://gist.githubusercontent.com/tdhock/1f01f3359f60582a67cf/raw/19504d4bdf7daa8bdec14868723ef88ded794d79/thumbnail.png

also I can upload lots of other files (text files). Is there some problem with uploading binary files?

> sessionInfo()
R version 3.1.0 (2014-04-10)
Platform: x86_64-unknown-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_CA.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_CA.UTF-8        LC_COLLATE=en_CA.UTF-8    
 [5] LC_MONETARY=en_CA.UTF-8    LC_MESSAGES=en_CA.UTF-8   
 [7] LC_PAPER=en_CA.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_CA.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
 [1] RSelenium_1.3.1    XML_3.98-1.1       caTools_1.16       gistr_0.0.2       
 [5] animint_2014.5.22  proto_0.3-10       RColorBrewer_1.0-5 lattice_0.20-29   
 [9] plotly_0.4         ggplot2_0.9.3.1.99 RJSONIO_1.0-3      RCurl_1.95-4.1    
[13] bitops_1.0-6      

loaded via a namespace (and not attached):
 [1] assertthat_0.1   colorspace_1.2-4 compiler_3.1.0   dichromat_2.0-0 
 [5] digest_0.6.4     evaluate_0.5.5   formatR_0.10     grid_3.1.0      
 [9] gtable_0.1.2     httr_0.2         knitr_1.5.34     labeling_0.2    
[13] MASS_7.3-31      munsell_0.4.2    plyr_1.8.1       Rcpp_0.11.1     
[17] reshape2_1.2.2   scales_0.2.3     stringr_0.6.2    tools_3.1.0     
tdhock referenced this issue in tdhock/animint Jun 6, 2014
@ramnathv
Copy link

ramnathv commented Jun 6, 2014

Yes. The only way to upload pngs is to use git. The way it would work is as follows:

  1. Clone the gist to your local computer.
  2. Add the image to the git repo.
  3. Push it back using git push.

There might be a simple way to automate this process within gistr.

@tdhock
Copy link
Author

tdhock commented Jun 6, 2014

ok, so if I understand correctly there is no problem with the gistr::gist_create function, and in fact the problem is that the gist server does not accept binary files. thanks for the info.

@tdhock tdhock closed this as completed Jun 6, 2014
@tdhock
Copy link
Author

tdhock commented Jun 6, 2014

it would be nice to have a more informative warning/error message though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants