0.0.3 • Published 4 years ago

@resize.to/transformer v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

resize.to transformer

Greenkeeper badge Coverage Status

Uses Sharp and streams to transform an image. It is meant to be used with an options-parser. This is a building block for creating image transformation services.

Example of using it directly:

const fs = require('fs')
const inputPath = 'path/to/image.jpg'
const inputStream = fs.createReadStream(inputPath)
const outputPAth = 'path/to/transformed/image.jpg'
const outputStream = fs.createWriteStream(outputPath)
const transformer = new Transformer([
	backgroundalpha: 1,
	backgroundcolor: '#000',
	backgroundrgb: 'rgb(0, 0, 0)',
	blur: 10,
	fit: 'cover',
	gravity: 'center',
	height: 200,
	left: null,
	mirror: null,
	output: null,
	quality: 80,
	rotate: null,
	top: null,
	version: null,
	width: 400
], inputPath)
transformer.transform(inputStream, outputStream)
0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

5 years ago