Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/binocarlos/glob-resize
resize images matching a file glob and write them to a target folder
https://github.com/binocarlos/glob-resize
Last synced: 11 days ago
JSON representation
resize images matching a file glob and write them to a target folder
- Host: GitHub
- URL: https://github.com/binocarlos/glob-resize
- Owner: binocarlos
- Created: 2014-07-15T17:50:42.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-07-15T17:57:44.000Z (over 10 years ago)
- Last Synced: 2024-10-08T15:20:19.335Z (about 1 month ago)
- Language: JavaScript
- Size: 648 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
glob-resize
===========resize images matching a file glob and write them to a target folder
you need [ImageMagick](http://www.imagemagick.org/) on your system
## install
```
$ npm install glob-resize
```## usage
```js
var resize = require('glob-resize')var sourceFolder = __dirname + '/images'
var targetFolder = __dirname + '/output'resize(sourceFolder, ['**/*.png'], targetFolder, '100x100', function(err){
// all the matching files are resized into targetFolder
})
```## api
#### `resize(sourceFolder, globArray, targetFolder size, callback)`
Resize a folder of images - sourceFolder is where the images live, globArray is the list of matching image globs.
TargetFolder is where to resize them to and size is a string 'widthxheight'
## licence
MIT