Skip to content

Update 仓库.js to works with png - #649

Open
wdison wants to merge 1 commit into
github-tools:masterfrom
wdison:patch-1
Open

Update 仓库.js to works with png#649
wdison wants to merge 1 commit into
github-tools:masterfrom
wdison:patch-1

Conversation

@wdison

@wdison wdison commented Apr 12, 2021

Copy link
Copy Markdown

Using the raw parameter within the options of the writeFile method, this tool works with the sending of png images, it has not been tested with other files, but I think this solution will work for others as well.

  writePng(fileNamePng:string,base64Png:any,commitMsg:string=''){
    let initialMessage=commitMsg||'Commit de '+base64Png;
    let option = {encode:false,raw:true}
    const promise = this.bagRepo.writeFile('master', fileNamePng, base64Png, initialMessage, option);
    promise.then((valor:any) => {
      // console.log(valor);
    },this.initRepo);
    return promise;
  }

Using the raw parameter within the options of the writeFile method, this tool works with the sending of png images, it has not been tested with other files, but I think this solution will work for others as well.

```
writePng(fileNamePng:string,base64Png:any,commitMsg:string=''){
    let initialMessage=commitMsg||'Commit de '+base64Png;
    let option = {encode:false,raw:true}
    const promise = this.bagRepo.writeFile('master', base64Png, base64Png, initialMessage, option);
    promise.then((valor:any) => {
      // console.log(valor);
    },this.initRepo);
    return promise;
  }
```
@wdison

wdison commented Jun 3, 2021

Copy link
Copy Markdown
Author

Dear @j-rewerts and other merge makers, I hope you're all right.

This change is small very simple, but it brings a lot of gain to the api, it has compatibility with any other preexisting call to this method, and it is very useful for other users.

Please consider this for merging.

@GETBACKGANG

Copy link
Copy Markdown

Replying to recent gmail I received from you

@GETBACKGANG

GETBACKGANG commented Jun 4, 2021 via email

Copy link
Copy Markdown

注册 for free to join this conversation on GitHub. Already have an account? 登录 to comment

标签

None yet

项目

None yet

Development

Successfully merging this pull request may close these issues.

2 participants