Title: How to retrieve blob with binary content? · Issue #83 · nodegit/nodegit · GitHub
Open Graph Title: How to retrieve blob with binary content? · Issue #83 · nodegit/nodegit
X Title: How to retrieve blob with binary content? · Issue #83 · nodegit/nodegit
Description: Hello! I tried to retrieve a binary blob (a 13k PNG file) using the #wip branch (on OSX): Git.Repo.open(REPO_PATH, function(error, repo) { repo.getBlob(oid, function(error, blob) { var content = blob.content(); if (blob.isBinary()) { fs....
Open Graph Description: Hello! I tried to retrieve a binary blob (a 13k PNG file) using the #wip branch (on OSX): Git.Repo.open(REPO_PATH, function(error, repo) { repo.getBlob(oid, function(error, blob) { var content = bl...
X Description: Hello! I tried to retrieve a binary blob (a 13k PNG file) using the #wip branch (on OSX): Git.Repo.open(REPO_PATH, function(error, repo) { repo.getBlob(oid, function(error, blob) { var content = bl...
Opengraph URL: https://github.com/nodegit/nodegit/issues/83
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"How to retrieve blob with binary content?","articleBody":"Hello! I tried to retrieve a binary blob (a 13k PNG file) using the `#wip` branch (on OSX):\n\n```\nGit.Repo.open(REPO_PATH, function(error, repo) {\n repo.getBlob(oid, function(error, blob) {\n var content = blob.content();\n if (blob.isBinary()) {\n fs.writeFileSync('BROKEN.png', content);\n }\n });\n});\n```\n\nThe first 4 or 5 bytes seem to match (they are `ffd8 ffe0 00`) but the rest of the bytes seem to be random memory; they change on subsequent retrievals of the same blob.\n\nHowever, text files seem to work. Am I doing something dumb?\n","author":{"url":"https://github.com/philschatz","@type":"Person","name":"philschatz"},"datePublished":"2013-09-03T15:51:02.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/83/nodegit/issues/83"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:97298143-d7f8-5604-22f0-a225b70048dd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 95F4:2C32F8:367438A:47E2D18:6A5D2641 |
| html-safe-nonce | b85364c0fc0a277b1fa6817cee6fc3496eeda9480616605451d5c2e2d942263e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NUY0OjJDMzJGODozNjc0MzhBOjQ3RTJEMTg6NkE1RDI2NDEiLCJ2aXNpdG9yX2lkIjoiNzE0MTIzNjc5MDQ5NDMwNzkwNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4ce46b08f6c17a2859d4f30cd4213ea231e6e5fe9665373f1ec49b0ed5a7ae64 |
| hovercard-subject-tag | issue:18916310 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodegit/nodegit/83/issue_layout |
| twitter:image | https://opengraph.githubassets.com/cb1d7f87a99b40df1a8dfe677298e06063db00066228ec58db25f75c3fe6aaa5/nodegit/nodegit/issues/83 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/cb1d7f87a99b40df1a8dfe677298e06063db00066228ec58db25f75c3fe6aaa5/nodegit/nodegit/issues/83 |
| og:image:alt | Hello! I tried to retrieve a binary blob (a 13k PNG file) using the #wip branch (on OSX): Git.Repo.open(REPO_PATH, function(error, repo) { repo.getBlob(oid, function(error, blob) { var content = bl... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | philschatz |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| turbo-cache-control | no-preview |
| go-import | github.com/nodegit/nodegit git https://github.com/nodegit/nodegit.git |
| octolytics-dimension-user_id | 657068 |
| octolytics-dimension-user_login | nodegit |
| octolytics-dimension-repository_id | 1383170 |
| octolytics-dimension-repository_nwo | nodegit/nodegit |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1383170 |
| octolytics-dimension-repository_network_root_nwo | nodegit/nodegit |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width