Created
          May 21, 2018 02:03 
        
      - 
      
- 
        Save AndikaR/bf360e726630e83e4adc68cfd369c7be to your computer and use it in GitHub Desktop. 
    Example of Node Graphic Magic
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | var fse = require('fs-extra'); | |
| let gm = require('gm'); | |
| var readStream = fse.createReadStream('./public/test.png'); | |
| gm(readStream, 'test.png') | |
| .borderColor('#000') | |
| .trim() | |
| .crop(50, 50, 0, 0) | |
| .write('./public/test-1.png', function (err) { | |
| if (!err) console.log('done'); | |
| }); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment